how to practice JDBC programming?

L

Leo

Dear All,

I am reading a book to learn JDBC. I hope to have hands on practice. But
it seems requires database installed, etc. I do have a Oracle expression
version installed in my Window XP. But I have never used it.

Do I need to learn Oracle first? Like creating tables, etc. Then I may
start to practice JDBC. It seems the learning curve is too long. Any
other straight ways to learn it?

Thank you very much.
 
J

Jon Martin Solaas

Leo said:
Dear All,

I am reading a book to learn JDBC. I hope to have hands on practice. But
it seems requires database installed, etc. I do have a Oracle expression
version installed in my Window XP. But I have never used it.

Do I need to learn Oracle first? Like creating tables, etc. Then I may
start to practice JDBC. It seems the learning curve is too long. Any
other straight ways to learn it?

No, not really. It's like you really, really want to learn to drive a
car, but without really have to ever get inside one.

Oracle is one of the top database systems out there, and Oracle XE is
supposed to be very, very easy to use. It has a web interface for
administration, so it's very easy to create tables, schemas and stuff.
If I'm not mistaken, a sample schema is also installed, (maybe it's an
install-option), and for practicing purposes, like jdbc training, it'd
be very convenient.

That said, there exist simpler and smaller databases than Oracle, like
HSQLDB, written entirely in Java, or PostgreSQL and MySQL which both
have administration tools letting you create tables without using SQL
create statements.

The easiest way would probably be to create the database in MS Access,
if it is familiar to you, and use the odbc-jdbc bridge included in the
JDK to access it. This is far from what I'd recommend for any real
application, but for training purposes it'd work just fine.

Finally, JDBC isn't an abstraction layer on top of SQL, so basically you
can't do much in JDBC, except making the db connection, if you don't
know how to do it in SQL first. Answering your question "Do I need to
learn Oracle?" I'd say you don't have to learn Oralce, but if you're not
comfortable with SQL you should learn that first. And it's much better
to get the basic SQL knowledge interacting with the dababase directly,
rather than through JDBC, so that you always know that errors stem form
the database and don't have to figure out if it's jdbc-related or
database-related.
 
R

Roedy Green

It has a web interface for
administration, so it's very easy to create tables, schemas and stuff.
If I'm not mistaken, a sample schema is also installed, (maybe it's an
install-option), and for practicing purposes, like jdbc training, it'd
be very convenient.

You can learn a lot quickly playing with those interfaces. Build
yourself some tables and start experimenting typing in SQL command to
query, update etc Once you get the hang of how SQL works, you can
put on the diving suit and do it with JDBC which is extremely clumsy
in comparison.
 
J

Jon Martin Solaas

Roedy said:
You can learn a lot quickly playing with those interfaces. Build
yourself some tables and start experimenting typing in SQL command to
query, update etc Once you get the hang of how SQL works, you can
put on the diving suit and do it with JDBC which is extremely clumsy
in comparison.

Yup. Also, check out if the tool used will (let you) preview the actual
sql commands. Enterprise Manager in Oracle 10g and apex in XE will do
that for instance when you have run thru the create-table-wizard-pages
and is about to actually create the table.
 
J

Jon Martin Solaas

Jon said:
Yup. Also, check out if the tool used will (let you) preview the actual
sql commands. Enterprise Manager in Oracle 10g and apex in XE will do
that for instance when you have run thru the create-table-wizard-pages
and is about to actually create the table.

PS, even MS Access will let you look at the SQL generated, for instance
when you use the SQL builder. But the Access SQL is not exactly
standards conformant ...
 
T

timjowers

Leo,

Forget ORCL. Dinosaur.

Access is good for a beginner in db. Graphical. AFAIK ORCL still never
has produced a decent graphical front end. Give MSFT credit for that.
If you must ORCL then get TOAD or SQuirrel as frontend GUIs. I think
SQuirreL handles the SQL in the most SQL99 compliant fashion from the
little bit of it I played with (single table port from db2 to Orcl).

Once you're ready to do real work then: http://www.postgresql.org/
Run PGAdmin tool. It can be all clickety-click as well like Access but
a little less simplistic. Create a db. Create some tables. Right click
to add some data. Hit it with Java code and you're off to the races.
You should be able to find lots of Java examples for JDBC. You know is
rdbms is set math? Sets are simple and intuitive.

Enjoy!
TimJowers
 
J

jcsnippets.atspace.com

Jon Martin Solaas said:
No, not really. It's like you really, really want to learn to drive a
car, but without really have to ever get inside one.

Oracle is one of the top database systems out there, and Oracle XE is
supposed to be very, very easy to use. It has a web interface for
administration, so it's very easy to create tables, schemas and stuff.
If I'm not mistaken, a sample schema is also installed, (maybe it's an
install-option), and for practicing purposes, like jdbc training, it'd
be very convenient.

Oracle XE is indeed a good choice - a sample database was included in just
about every version of Oracle I ever encountered.

As for the question regarding having to learn how to create tables etc...
there are many sites out there with simple, concise examples. Do a Google
(Google is your friend) search for 'oracle "create table" ' for example, and
it will bring up a lot of examples. As long as you're just messing with the
database to get some exercise in Java, these examples will suffice.

Best regards,

JayCee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top