jdbc connection to MS access database
- From: jinto12 <jinto12@xxxxxxxxx>
- Date: 23 May 2007 23:21:21 -0700
Im trying to connect my database. im using ms access when i try to
execute my program it gives me this error
i create my database by going to the odbc in the administrative tools.
and when i try to execute my code it gives me this error:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at Transit.main(Transit.java:16)
and this is the code im using.
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception e){
e.printStackTrace(System.err);
}
Connection con;
Statement stmt;
//connecting to the database.
try{
con=DriverManager.getConnection("jbdc:odbc:Hw3");//this is where
its giving me errors
stmt=con.createStatement();
con.close();
stmt.close();
}
catch(Exception sqle){
sqle.printStackTrace(System.err);
}
any suggestions do i have to download any updates or something im
using java 1.5 sdk.
.
- Follow-Ups:
- Re: jdbc connection to MS access database
- From: Bjorn Abelli
- Re: jdbc connection to MS access database
- Prev by Date: Re: JDBC: Fast way to find the number of rows in a ResultSet?
- Next by Date: Re: JDBC: Fast way to find the number of rows in a ResultSet?
- Previous by thread: Opening with MNC for "Project Lead"
- Next by thread: Re: jdbc connection to MS access database
- Index(es):
Relevant Pages
|
|