Sign in with
Sign up | Sign in
Your question

HELPP!! JAVA Access Database Connection

Tags:
  • Programming
  • Connection
  • Java
  • Database
  • Apps
Last response: in Apps General Discussion
Share
January 28, 2013 4:11:16 PM

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 = "jdbc:o dbc:D river={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

More about : helpp java access database connection

January 28, 2013 4:11:54 PM

Sorry Netbeans 7.2.1
m
0
l
!