Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

jdbc connect Access

Ranch Hand
Posts: 235
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to JDBC. I tried to connect to MS Access, but always give the following error:
C:\>java JdbcTest1
Error Creating Record
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at JdbcTest1.doTest(
at JdbcTest1.main(
I try to look through all the threads, but unable to solve it.
Please help. I use jdk 1.3 . I did go to settings->control panel to create a DSN.
Here is the program (taken from this forum)
import java.sql.*;
public class JdbcTest1 {
public void doTest(){
Connection con = DriverManager.getConnection("jdbc odbc:Records","","") ;
Statement stmt = con.createStatement();
System.out.println("Table Created?"+stmt.executeUpdate("create table mytable (sno integer, name varchar(20) )"));
System.out.println("Inserted?"+stmt.executeUpdate("insert into mytable values (1, 'Silly')"));
System.out.println("Inserted?"+stmt.executeUpdate ("insert into mytable values (2, 'Ken')"));
ResultSet rs = stmt.executeQuery("select * from mytable");
while ( ){
System.out.println("SNO ==>"+rs.getInt("sno")+"\n");
System.out.println("SNO ==>"+rs.getString("name")+"\n");
}catch (Exception e){
System.out.println("Error Creating Record");
public static void main( String[] args ) {
JdbcTest1 test = new JdbcTest1();
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you have a space (" ") instead of a colon (":") between "jdbc" and "odbc" in your URL. In other words, it should be:
instead of:
jdbc odbc:Records
The error message you received indicates that no registered driver understands the URL you specified, which in this case is because the URL is incorrect.
Brett Spell
Author, Professional Java Programming
[This message has been edited by Brett Spell (edited March 21, 2001).]
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Brett,
After changing the space, it works now. Thanks
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic