The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "DatabaseConnection" Watch "DatabaseConnection" New topic



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 Source)
at Source)
at$100(Unknown Source)
at$ Source)
at Method)
at 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
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DatabaseConnection.main(

please clarify me reason for above exception.

Paul Sturrock

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

Joined: Jan 10, 2002
Posts: 63858

"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.

Forum Bartender

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

Joined: Oct 11, 2000
Posts: 1141

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:

Good Luck,
I agree. Here's the link:
subject: DatabaseConnection
It's not a secret anymore!