Hi recently been working on a school project. But i reinstalled my OS and now my Database wont connect to JAVA using the ODBC connection
Here is the code:
try{
String filename = "BandB.mdb";
String database = "jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=";
database += filename.trim () + ";DriverID=22;READONLY=true}";
conn = DriverManager.getConnection (database, "", "");
System.out.println ("Connection to BandB database successfully established");
}
catch (Exception e)
{
System.out.println ("Unable to connect to the database " + e);
}
} //end connect
It works on my home pc but it wont run on my laptop. Also no other similar program will run on it. I reinstalled to SP1 and that is when the problem started. It gives me this error:
Driver successfully loaded
Unable to connect to the database java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Is there something wrong with my OS or is this my Compiler problem. I am using Netbeans 2.7.1
Here is the code:
try{
String filename = "BandB.mdb";
String database = "jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=";
database += filename.trim () + ";DriverID=22;READONLY=true}";
conn = DriverManager.getConnection (database, "", "");
System.out.println ("Connection to BandB database successfully established");
}
catch (Exception e)
{
System.out.println ("Unable to connect to the database " + e);
}
} //end connect
It works on my home pc but it wont run on my laptop. Also no other similar program will run on it. I reinstalled to SP1 and that is when the problem started. It gives me this error:
Driver successfully loaded
Unable to connect to the database java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Is there something wrong with my OS or is this my Compiler problem. I am using Netbeans 2.7.1