框架修炼之ssm-Mybatis学习笔记一
早期ssh框架:spring struts2 hibernate. 目前使用ssm:spring(service) springMVC(servlet) mybatis(jdbc DbUtil) JDBC回顾 1 准备数据库tb_user @Test public void test ( ) throws Exception { // 1 加载驱动 Connection connection = null ; PreparedStatement Statement = null ; ResultSet resultSet = null ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; // 2 获取连接 connection = DriverManager . getConnection ( "jdbc:mysql://localhost:3306/mybatis" , "root" , "1234" ) ; // 3 获取preparestatement String sql = "select * from tb_user where id = ?" ; Statement = connection . prepareStatement ( sql ) ; // 4 设置参数 Statement . setLong (