PreparedStatement

We have noticed that it's very inconvenient to use class Statement to execute aSQL statement.

So we have another solution which is PreparedStatement.

PreparedStatement ps=conn.prepareStatement("...... ");

ps.setInt(... , ...);

ps.setString(... , ....);

....then

ps.execute();


--->It's easy to use...

要查询数据,必须将类型写全,不能用select * from ....



posted @ 2012-07-19 00:54  胡.杰  阅读(132)  评论(0编辑  收藏  举报