Java Desktop app with Ms Access.
Posted
by
zayar
on Stack Overflow
See other posts from Stack Overflow
or by zayar
Published on 2010-07-29T02:17:01Z
Indexed on
2010/12/25
19:53 UTC
Read the original article
Hit count: 239
My Db connection is error "class not found exception
!".
I want to show in java jTable with query result..
static Connection databaseConnection()throws ClassNotFoundException{
Connection con=null;
File file=new File("PlayDb/PlayIS.mdb");
try{
Class.forName("sun.jdbc.odbc.jdbcodbcDriver");
con =DriverManager.getConnection("jdbc:odbc:Driver="+"{Microsoft Access Driver(*.mdb,*.accdb)};DBQ="+file.getAbsoluteFile());
System.out.print("Success con!!");
}
catch(Exception e){
System.out.print("connection fail!!");
e.printStackTrace();
}
return con;
}
© Stack Overflow or respective owner