This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
How to connect jdk1.7 and oracle 10g express edition in eclipse
Deepak Rajendran
Greenhorn
Joined: Aug 26, 2010
Posts: 16
posted
0
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
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.
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!
:-)
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.
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.
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"?
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.
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.
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.
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.
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