日期:2014-05-16 浏览次数:20597 次
db2jcc.jar
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance(); String url = "jdbc:db2://localhost:50000/SAMPLE"; Connection con = DriverManager.getConnection(url, user, password);
db2java.zip
// 连接本机数据库 Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance(); String url = "jdbc:db2:sample"; Connection con = DriverManager.getConnection(url, user, password);
// 连接远端主机数据库 Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").newInstance(); String url = "jdbc:db2://remotehost:50000/sample"; Connection con = DriverManager.getConnection(url, user, password);