File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes the question is about JDBC/ODBC MS Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

the question is about JDBC/ODBC MS Access

david hw wang

Joined: Mar 14, 2006
Posts: 7
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

Joined: Aug 31, 2004
Posts: 11343

I think this was better where originally posted. Please continue the discussion there.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: the question is about JDBC/ODBC MS Access
jQuery in Action, 3rd edition