preparedstatement
- 网络处理命令
-
The following code snippets show the differences when using a Statement and a PreparedStatement .
下面的代码片段显示使用Statement与使用PreparedStatement的不同之处。
-
To do so , define a new PreparedStatement by writing the SELECT query as appropriate .
为此,可以相应地编写SELECT查询来定义一条新的PreparedStatement。
-
In this article , you learned how to more effectively use PreparedStatement objects to support more advanced queries .
在本文中,您了解了如何更有效地使用PreparedStatement对象来支持更高级的查询。
-
As shown in this example , you can also create a PreparedStatement to perform dynamic queries by using the ij tool .
如本例中所示,还可以创建一条PreparedStatement来使用ij工具执行动态查询。
-
After this new PreparedStatement has been created , you can use it to insert new data into the products table by using the EXECUTE command .
在创建了这条新PreparedStatement之后,可以通过使用EXECUTE命令来使用它把新数据插入products表。
-
By using streams with a PreparedStatement , you can quickly insert large quantities of complex data into your Apache Derby database .
通过把流与PreparedStatement结合使用,可以将大量复杂数据快速插入ApacheDerby数据库。
-
With the ij tool , you can accomplish this by using the REMOVE command to remove the PreparedStatement .
通过ij工具,可以使用REMOVE命令删除PreparedStatement来完成此过程。
-
If you try to reuse this PreparedStatement after it 's been removed , an error is generated because the internal resources are no longer available .
如果尝试在删除后重用这条PreparedStatement,将生成错误,因为内部资源不再可用。
-
The PreparedStatement interface has been modified with subsequent JDBC revisions , providing additional functionality , which this article explores in more detail .
后续的JDBC修订版已经修改了PreparedStatement接口,使该接口可以提供附加功能,本文将对附加功能进行详细探究。
-
Previously , you used a PreparedStatement to insert data into an Apache Derby database from within both a Java program and the ij tool .
先前,您使用了PreparedStatement从Java程序和ij工具把数据插入ApacheDerby数据库。
-
In this case , you want to disable autocommit mode because you reuse the same JDBC PreparedStatement more than once .
在这种情况下,需要禁用自动提交模式,因为将多次重用同一条JDBCPreparedStatement。
-
Both statements can use the PreparedStatement syntax ( see Resources ) of "?" for a parameter , in which case the username will be set for every parameter .
这两条语句都可以使用带“?”的PreparedStatement语法作为一个参数(请参见参考资料),在这种情况下,将为每个参数设置用户名。
-
When you 're done using a PreparedStatement object , you need to inform that database that the internal database resources allocated for the PreparedStatement can be released .
使用PreparedStatement对象完成操作后,需要通知该数据库分配给PreparedStatement的内部数据库资源可以释放了。
-
The opposite is true : PreparedStatement is recommended when a simple statement is executed many times with different values because the statement has to be compiled only once .
相反,如果要反复执行多次一条简单的语句,并且每次使用不同的值执行,建议使用PreparedStatement,因为语句只需编译一次。
-
This included using the ij tool to prepare , execute , and remove a PreparedStatement , which can be useful when you 're prototyping different approaches .
这包括了使用ij工具准备、执行和删除PreparedStatement,它们会在构建不同方法的原型时十分有用。
-
Instead , you would need to create another preparedStatement for the delete , and another message would be sent to the database server to prepare the statement for the delete query .
而是需要另外创建一个preparedStatement来执行删除操作,且另外会有一条消息被发送到数据库服务器来准备删除查询语句。
-
The SQL Maps framework will create a PreparedStatement instance , set any parameters using the provided parameter object , execute the statement , and build a result object from the ResultSet .
SQLMaps框架将创建一个PreparedStatement实例,使用所提供的参数对象设置所有参数、执行语句以及从ResultSet中构建一个结果对象。
-
Next , you were introduced to the concept of streaming data into a JDBC application , in this case a PreparedStatement parameter , to more efficiently insert data into an Apache Derby database .
接下来,向您介绍了把数据注入JDBC应用程序的概念;在本例中,PreparedStatement参数,用于将数据更高效地插入ApacheDerby数据库。
-
On the other hand , creating a PreparedStatement object introduces a certain amount of overhead , so , ideally , the statement 's lifetime will be sufficiently long to compensate for this overhead .
在另一个方面,建立一个PreparedStatement对象会带来一定量的系统开销。所以,在理想情况下,这条语句的生命周期应该足够长,以补偿它所带来的系统开销。