Bookmark Topic Watch Topic
  • New Topic

the question is about JDBC/ODBC MS Access

david hw wang
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
at first I posted it on General(beginner), but I think here is better

thank you


runtime java.lang.NoClassDefFoundError when trying jdbc
Hi, I am fresh new in java and, when I try to connect with Access Database, I got the runtime Error (compiled fine)

It bothered me three days, and I am really tired,

Thank you first


that's what I have done:

jdk 1.4


e:\sun\appserver;E:\Sun\Tomcat 5.5\webapps\tsf\WEB-INF\classes



tools.jar in e:\sun\appserver\jdk\lib


built up a dababase with access : test.mdb
with one table customer (two colums: cust_id,cust_name)


setup odbc in winXP homeEdition

control pannel --> administrative tools --> data source(ODBC)-->
system DSN--> Mrcrosoft Access Driver(*.mdb) -->
with dataSourceName : testconnect ; and I put the description;
select database :test.mdb;
advanced option with loginName tester ;password: tester

then I copied the following from internet:


import java.sql.*;

class JdbcTest1{

public static void main(String args[]){
String url = "jdbc dbc:testconnect";
Connection conc = DriverManager.getConnection(url, "tester","tester");
Statement stmt=conc.createStatement();
ResultSet rs=stmt.executeQuery("select * from customer");

String s1=rs.getString("cust_id");
String s2=rs.getString("cust_name");
catch(Exception e){
javac fine
java JdbcTest1
Exception in thread main java.lang.NoClassDefFoundError: JdbcTest1

marc weber
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think this was better where originally posted. Please continue the discussion there.
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!