• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Oracle database connection

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want in detail how to connect to oracle databse.

Regarding classpath,what to install.

I have j2sdk1.4.2,oracle8i,tomcat6.0

Class.forName("Oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.10.5:1521:bits", "buildnova", "nova");
error:
java.lang.ClassNotFoundException: Oracle.jdbc.driver.OracleDriver
please let me know how to resolve this error
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the Oracle JDBC in the classpath of your application. JDBC drivers do not come with java.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need the driver. The driver is something that takes your makes your jdbc java calls, understandable to database.
You will find the oracle driver in folder "jdbc" of oracle isntallation directory.
The name of driver is "ojdbc14.jar".
Put this driver(jar file), in your classpath, and the above application will run smoothly.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The name of driver is "ojdbc14.jar"


For Oracle 8i it is classes12.zip.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul,
For your information, the java/JDBC/database interoperability information is available in the Oracle JDBC FAQ:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html

Good Luck,
Avi.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Avi Abrami:
Paul,
For your information, the java/JDBC/database interoperability information is available in the Oracle JDBC FAQ:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html

Good Luck,
Avi.



Thank you Avi, I'm very aware of that. My intention was to correct agun nohwar's post, Oracle 8i does not ship with ojdbc14.jar, it ships with classes12.jar, so anu rani will not be able to find that jar file.

They could (and probably should) of course download a much more recent driver directly from Oracle.
 
reply
    Bookmark Topic Watch Topic
  • New Topic