public static void test_conn(){
try
{
// Step 1: Load the JDBC driver.
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc: MS Access Database";
Connection conn = DriverManager.g etConnection(ur l);
System.out.prin tln("connection login timeout "+DriverManager .getLoginTimeou t());
}
catch (Exception e)
{
System.err.prin tln("Got an exception! ");
System.err.prin tln(e.getMessag e());
}
}
When I run these codes i get the following exception :
"Got an exception!
No data found"
I doubt there is a problem with my url..I've used the Ms access datasource and I want to connect to a database named test.mdb...
How can I achieve this ?
Thabks in adv
try
{
// Step 1: Load the JDBC driver.
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc: MS Access Database";
Connection conn = DriverManager.g etConnection(ur l);
System.out.prin tln("connection login timeout "+DriverManager .getLoginTimeou t());
}
catch (Exception e)
{
System.err.prin tln("Got an exception! ");
System.err.prin tln(e.getMessag e());
}
}
When I run these codes i get the following exception :
"Got an exception!
No data found"
I doubt there is a problem with my url..I've used the Ms access datasource and I want to connect to a database named test.mdb...
How can I achieve this ?
Thabks in adv