jdbc。。
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbname", "user", "password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("sql");
rs.close();
stmt.close();
conn.close(); |