title: How to connect java to Ms access Database
body: <p>i'm trying to connect the java to ms access database but it didn't work really well</p>
  
  <p>and i got an error message like this</p>
  
  <pre><code>sun.jdbc.odbc.JdbcOdbcDriver
  </code></pre>
  
  <p>this is my code :</p>
  
  <pre><code>import java.sql.*;
  
  public class main{
      public static void main(String[] args) {
  
          try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection con = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver(*.accdb)};DBQ=D:\\Andries\\testdatabase.accdb");
              Statement st = con.createStatement();
          }catch(Exception ex){
              System.out.println(ex.getMessage());
          }
  
      }
  }
  </code></pre>