java中的PreparedStatement 接口继承了Statement,并与之在两方面有所不同:有人主张,在JDBC应用中,如果你已经是稍有水平开发者,你就应该始终以PreparedStatement代替Statement.也就是说,在任何时候都不要使用Statement。
To do so, define a new PreparedStatement by writing the SELECT query as appropriate.
为此,可以相应地编写SELECT查询来定义一条新的PreparedStatement。
In this example, you first define the PreparedStatement as you did earlier in Listing 2.
在本例中,首先像先前在清单2中所做的一样定义PreparedStatement。
By using a PreparedStatement, you can dynamically modify your SQL statement at run time.
通过使用PreparedStatement,可以在运行时动态修改sql语句。
java中的PreparedStatement 接口继承了Statement,并与之在两方面有所不同:有人主张,在JDBC应用中,如果你已经是稍有水平开发者,你就应该始终以PreparedStatement代替Statement.也就是说,在任何时候都不要使用Statement。
应用推荐