Connection的preparedStatement方法对SQL进行预处理,生成数据库底层命令,并将该命令封装在preparedstatement中,可以提高数据库访问速度。
如sql=con.prepareStatement("select * from test1");
查询用sql.executeQuery()
增删改用sql.executeUpdate()
Connection的preparedStatement方法对SQL进行预处理,生成数据库底层命令,并将该命令封装在preparedstatement中,可以提高数据库访问速度。
如sql=con.prepareStatement("select * from test1");
查询用sql.executeQuery()
增删改用sql.executeUpdate()