File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes DatabaseConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DatabaseConnection" Watch "DatabaseConnection" New topic
Author

DatabaseConnection

Ramesh
Greenhorn

Joined: Feb 07, 2005
Posts: 3
Hi All,

I have written a simple JDBC program but I am not able to connect to the database, I am getting runtime exception with following message

Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/Savepoint
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DatabaseConnection.main(DatabaseConnection.java:27)

please clarify me reason for above exception.

Thanks,
Ramesh.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

It would appear you don't have a copy of rt.jar in your classpath. Or possibly that you are using an old version of the JDK (pre 1.4)?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

"Ramesh GR",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Ramesh,
As Paul indicates, the Savepoint interface was introduced in JDK 1.4. Therefore you need to be using JDK 1.4.x in order to use "Savepoint". And you also need to use an Oracle JDBC driver which is compatible with JDK 1.4.x. To find more information on Oracle JDBC drivers, please visit this Web page:

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

Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DatabaseConnection