- 加载驱动 Class.forName("com.mysql.jdbc.Driver");
- 建立连接 Connection conn=DriverManager.getConnection("jdbc:mysql://localhost//3306-----");
- 准备语句 stmt=conn.createStatement(); String sql="------";
- 执行语句ResultSet rs=stmt.executeQuery(sql);
- 处理结果--------
- 关闭资源rs.close();
转载于:https://www.cnblogs.com/huangzhe1515023110/p/9276122.html