1.加载数据库连接驱动
2.创建连接
3.打开连接
4.创建sql
5.执行操作
6.返回操作结果
7.关闭连接
String user = "root";
String password = "admin";
String url = "jdbc:mysql://localhost:3306/"+db;
String driver = "com.mysql.jdbc.Driver";
//String driver = "org.gjt.mm.mysql.Driver";
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
mysql连接语句