Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Deepak Rajendran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
:-)
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 24894
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 24894
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all for your help !!!
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic