tags:

views:

1001

answers:

4

Hello,

I have installed Oracle 10G XE. I want to connect to it using JDBC . Which driver should i use for it and from where can i download it ?

Thank You.

A: 

According to this getting started guide you need the Oracle Express client which can be found here

Mark Wilkins
You do not need Oracle Express client if you want to use JDBC. There is a pure-Java JDBC driver.
Thilo
+3  A: 

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html

You generally want the latest JDBC drivers, they will work with older versions of the database as well. Or, to be on the safe side, match the JDBC version with your DB.

Thilo
In fact, the correct version of the driver should be in the Oracle install tree somewhere after the install is completed.
Otis
+4  A: 

On the machine you have installed the server, Oracle JDBC drivers are in ORACLE_HOME/jdbc/lib. Just put ojdbc14.jar on your classpath (ojdbc14_g.jar is the same as ojdbc14.jar, except that classes were compiled with "javac -g" and contain some tracing information).

EDIT: According to Oracle Database 10g Release 2 (10.2.0.4) JDBC Drivers, ojdbc14.jar contains classes for use with JDK 1.4 and 1.5 (and I don't see why it wouldn't work with a JDK 6, some features of JDBC 4.0 won't just be available).

Some newer drivers are available at Oracle Database 11g Release 2 JDBC Drivers but I don't really see the difference between ojdbc14.jar and ojdbc15.jar (except that ojdbc15.jar requires a JDK 5+): they are both JDBC 3.0 driver so I think it's just a matter of end of life support for ojbdc14.jar. If you want JDBC 4.0 support, you'll need ojdbc16.jar though. Have a look at the Oracle JDBC FAQ if you want more details.

Pascal Thivent
A: 

You want to choose a JDBC driver that matches both your version of Oracle and the JDK you're using. ojdbc14.jar is for JDK 1.4; there are newer versions for at least JDK 5 that I know of. I'm not sure if there's a JDBC driver for JDK 6. Use the best match to your situation that Oracle makes available.

duffymo