aspose file tools*
The moose likes JDBC and the fly likes NoClassDefFoundError re JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "NoClassDefFoundError re JDBC " Watch "NoClassDefFoundError re JDBC " New topic
Author

NoClassDefFoundError re JDBC

Frances Fang
Greenhorn

Joined: Dec 01, 2000
Posts: 17
Hi,
I am learning JDBC from the book "Core Java2 Volumn II".
I installed the PointBase Mobile Edition database under the directory which I already put in CLASSPATH,the Java program and its properties file are in the same subdirectory and that subdirectory is under the same directory as the database's.
The compile is fine. But there is always a runtime exception stating that NoClassDefFoundError:filename. How to solve this problem?I am totally lost.Please help!
Thank you!
Frances
Frances Fang
Greenhorn

Joined: Dec 01, 2000
Posts: 17
Hi,
Forget about the title of this question. I have more detailed info about it. I debugged and found out where the problem is but I don't know why.
The code caused the problem is as follows, this is a method which will be called in main(),the main() handled exceptions:-
public static Connection getConnection()
throws SQLException, IOException
{ Properties props = new Properties();
String fileName = "MakeDB.properties";
FileInputStream in = new FileInputStream(fileName);
props.load(in);
String drivers = props.getProperty("jdbc.drivers");
if (drivers != null)
System.setProperty("jdbc.drivers", drivers);
String url = props.getProperty("jdbc.url");
String username = props.getProperty("jdbc.username");
String password = props.getProperty("jdbc.password");
return
DriverManager.getConnection(url, username, password);
}

The SQLException was thrown by DriverManager.getConnection(url,username,password),the error messages are as follows:-
the SQLState is :08001;
the error message is :no suitable driver
the vendor-specific info is: 0
In the corresponding proprieties file,it is:--
jdbc.drivers=com.pointbase.jdbc.jdbcDriver
jdbc.url=jdbc ointbase:corejava
jdbc.username=PUBLIC
jdbc.password=PUBLIC
I put the directory AA in classpath via
SET CLASSPATH=.;c:\AA
The pointbase is in c:\AA,the program and its properties file are in c:\AA\B\C. Is this a problem or am I missing something here? Please help!
Tks!
Frances

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError re JDBC
 
Similar Threads
Deleted the subdirectory from under the webapps
irritating behaviour of Tomcat 5
Unable to start Tomcat
How to adjust credentials used for Subversion in Eclipse Galileo
Unable to start Tomcat