mysql:Class.forName("com.mysql.jdbc.driver");Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/databasename", user, password); Statement statamentMySQL =connectMySQL.createStatement();ResultSet resultSel = statement.executeQuery( "select * from staff" );
oracle:Class.forName("oracle.jdbc.driver.OracleDriver");Connection c = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:databasename", user, password); Statement statamentMySQL =connectMySQL.createStatement();ResultSet resultSel = statement.executeQuery( "select * from staff" );
时间: 2024-10-22 16:35:47