connection string of jdbc odbc with MS access

14,195

Following connection string for JDBC-ODBC is working correctly.

  try
   {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String connectionQuery="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=path upto the database;uid=; pwd=password here;";  

    con = DriverManager.getConnection(connectionQuery,"",""); 
    st=con.createStatement();
    stmt=con.createStatement();

   }
    catch(Exception ex)
    {

     System.out.println("exception is"+ex);
    }
Share:
14,195
adesh singh
Author by

adesh singh

Application Programmer (Java , Python ) , Freelancer and Youtuber I publish programming related videos Link to my Youtube Channel: https://www.youtube.com/c/techyadesh

Updated on June 04, 2022

Comments

  • adesh singh
    adesh singh over 1 year

    I am trying to make jdbc odbc connection with ms access but not able to pass the password which is consisted from special characters

    I am using the following code
    
     try
     {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection con=DriverManager.getConnection("Jdbc:Odbc:Driver={Microsoft Access   
      Driver(*.mdb); DBQ=d:/abc/xyz.mdb};","","password here");
       Statement st=con.createStatement();
     }
     catch(Exception ex)
     {
    
     }
    

    but this is not recognising the password here even the password is much complex (combination of special characters)

  • adesh singh
    adesh singh about 10 years
    JDBC ODBC Connectivity is going to removed from JDK8