1.Access
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn = DriverManager.getConnection( "dbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=F:\\data.mdb", sUsr, sPwd);
2. MySQL (http://www.mysql.com) mm.mysql-2.0.2-bin.jar
Class.forName("org.gjt.mm.mysql.Driver");
cn = DriverManager.getConnection( "jdbc:mysql://MyDbComputerNameOrIP:3306/myDatabaseName", sUsr, sPwd );
或:
Class.forName("com.mysql.jdbc.Driver");
cn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/mydata?user=root&password=root");
3. Microsoft SQLServer (http://jtds.sourceforge.net)
Class.forName("net.sourceforge.jtds.jdbc.Driver");
cn = DriverManager.getConnection( "jdbc:jtds:sqlserver://MyDbComputerNameOrIP:1433/master", sUsr, sPwd );
4. Microsoft SQLServer (
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn = DriverManager.getConnection( "dbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=F:\\data.mdb", sUsr, sPwd);
2. MySQL (http://www.mysql.com) mm.mysql-2.0.2-bin.jar
Class.forName("org.gjt.mm.mysql.Driver");
cn = DriverManager.getConnection( "jdbc:mysql://MyDbComputerNameOrIP:3306/myDatabaseName", sUsr, sPwd );
或:
Class.forName("com.mysql.jdbc.Driver");
cn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/mydata?user=root&password=root");
3. Microsoft SQLServer (http://jtds.sourceforge.net)
Class.forName("net.sourceforge.jtds.jdbc.Driver");
cn = DriverManager.getConnection( "jdbc:jtds:sqlserver://MyDbComputerNameOrIP:1433/master", sUsr, sPwd );
4. Microsoft SQLServer (