File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes How to connect jdk1.7 and oracle 10g express edition in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to connect jdk1.7 and oracle 10g express edition in eclipse" Watch "How to connect jdk1.7 and oracle 10g express edition in eclipse" New topic
Author

How to connect jdk1.7 and oracle 10g express edition in eclipse

Deepak Rajendran
Greenhorn

Joined: Aug 26, 2010
Posts: 16
Hi,
i am using oracle 10g express edition and jdk 1.7.
I want to connect the both using eclipse.
what are the jars i need and please explain the steps clearly

Thanks in advance !
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

All you need is the Oracle JDBC driver JAR file. But you need that only to run the program. For writing and compiling the program, you don't need that JAR because the JDBC API is included in the JDK.


JBoss In Action
Deepak Rajendran
Greenhorn

Joined: Aug 26, 2010
Posts: 16
Thanks johnson!
please explain me clearly with the steps like which jar i have to use, where to include that in eclipse and how to run the code
please please reply as soon as possible
Thanks in advance!
:-)
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

you put the jar where you put every other jar in eclipse, you include it in your project buildpath.
you right click on the project and select the build path.
As for which jar file you need, show some effort.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Eclipse doesn't "run" databases. It doesn't connect to databases. For that, you either need a plugin that connects to databases such as the Database Explorer, or an database-using application, which means either a stand-alone Java app, a webapp, or something similar (a 2-tier applet, for example. But that's not recommended).

So just to begin with, how could we show an example, when we don't even know why you want to "connect Eclipse and Oracle"?


Customer surveys are for companies who didn't pay proper attention to begin with.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Tim Holloway wrote:Eclipse doesn't "run" databases. It doesn't connect to databases. For that, you either need a plugin that connects to databases such as the Database Explorer, or an database-using application, which means either a stand-alone Java app, a webapp, or something similar (a 2-tier applet, for example. But that's not recommended).

So just to begin with, how could we show an example, when we don't even know why you want to "connect Eclipse and Oracle"?


I hadn't even thought he might mean that....
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Wendy wrote:I hadn't even thought he might mean that....

Deepak's original question implies that but I don't think that's what he meant (but then who can tell with unclear questions!). I suspect he wanted to know how to develop a Java app in Eclipse where that app would connect to a database.

I would have provided details on getting and positioning the JDBC driver JAR file, but after a few minutes at the Oracle 10g download site I gave up - there is no clear JDBC JAR download link, and I was not about to install the whole thing just to see if it came with the driver. I suspect that if I looked long enough, and did enough googling, I could come up with the answer, but I would rather that Deepak did that work.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Peter Johnson wrote:
I would have provided details on getting and positioning the JDBC driver JAR file, but after a few minutes at the Oracle 10g download site I gave up - there is no clear JDBC JAR download link, and I was not about to install the whole thing just to see if it came with the driver. I suspect that if I looked long enough, and did enough googling, I could come up with the answer, but I would rather that Deepak did that work.


You just need to know how to Google properly. http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

Oh, you used a vendor's site search?

There is one "gotcha" with Oracle. Up to about 9i, they provided the driver in a file named "classes12.zip". It was actually a JAR file, but it didn't carry the ".jar" extension for some screwball reason.

There's no virtue to using a driver that old these days, but still, it's worth mentioning. Some folks still think that they can safely do production work with Java 1.3.
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Oracle's JDBC drivers come with the database itself but can also be downloaded separately. You can download the drivers for Oracle 11g, which should still work for an Oracle 10g DB.

Oracle 11g drivers: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html (download ojdbc5.jar or ojdbc6.jar)
Oracle 10g drivers: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-10201-088211.html (download ojdbc14.jar)

Edit: if you already have a DB installed, you can find the jdbc drivers right there. For instance on Linux: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib
I assume Windows equivalent would be something like: C:\oracle\xe\app\oracle\product\10.2.0\server\jdbc\lib
Or just do a file search on ojdbc14.jar
Deepak Rajendran
Greenhorn

Joined: Aug 26, 2010
Posts: 16
Thanks all for your help !!!
 
jQuery in Action, 2nd edition
 
subject: How to connect jdk1.7 and oracle 10g express edition in eclipse