unable to connect to mdb file using eclipse

girish979's Avatar, Join Date: Nov 2009
Newbie Member
Hi,
Im trying to connect to MsAccess file using Eclipse, but im getting the error
Code:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
I have added the ojdbc14.jar to Bulid Path for the project & the access file is in the Bin Folder.

& this is the code
Code:
try
        {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

                       Connection con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=testdb2.mdb","","");
            
                  
            Statement stmt = con.createStatement();
            String s = "insert into student values(521,'test1');";
            stmt.executeUpdate(s);
            con.commit();
            stmt.close();
            con.close();
            
            
        }
        catch(Exception e)
        {

            System.out.println(e);
            
        }
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Duplicate of Unable To Connect To Access File Using Eclipse. Thread closed.

Do not create the same thread over and over again.