Using DSN-less connection : JDBC ODBC « Database SQL JDBC « Java






Using DSN-less connection

  
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
  public static void main(String[] argv) throws Exception {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String myDB = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/data.MDB";
    Connection conn = DriverManager.getConnection(myDB, "", "");
  }
}

   
    
  








Related examples in the same category

1.jdbc:odbc bridge
2.JdbcOdbc Connect
3.jdbc odbc bridge connection string
4.Simple example of JDBC-ODBC functionality
5.Using a PreparedStatement through sun.jdbc.odbc.JdbcOdbcDriver
6.Creating and using a stored procedure with sun.jdbc.odbc.JdbcOdbcDriver
7.Retrieving a ResultSet from JdbcOdbcDriver
8.Getting an output parameter from a stored procedure
9.Opening an updatable ResultSet
10.Using ResultSetMetaData from jdbc:odbc
11.Creating a table using JdbcOdbcDriver
12.Using INSERT with JdbcOdbcDriver
13.Using UPDATE with JdbcOdbcDriver
14.Creating and dropping indexes