1.JDBC连接mysql:
String connUrl = "jdbc:mysql://localhost:3306/testDb";
String connUser = "root";
String connPwd = "root";
Class.forName("com.mysql.jdbc.driver");
Connection conn = DriverManager.getConnection(connUrl,connUser,connPwd);
2.JDBC连接oracle:
String connUrl = "jdbc:oracle:thin:@localhost:1521:testDb";
String connUser = "root";
String connPwd = "root";
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(connUrl,connUser,connPwd);