java中预处理语句preparedStatement

来源:互联网 发布:怎么修复u盘里的数据 编辑:程序博客网 时间:2024/06/05 00:51

Connection的preparedStatement方法对SQL进行预处理,生成数据库底层命令,并将该命令封装在preparedstatement中,可以提高数据库访问速度。

如sql=con.prepareStatement("select * from test1");

查询用sql.executeQuery()

增删改用sql.executeUpdate()

0 0
原创粉丝点击