Can we use the one instance of Statment to execute more
than one query ?
Answers were Sorted based on User's Feedback
Answer / sathya
Yes,its possible to use the same instance provided the
Result Set of the first Statement is fetchd out.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sachin
To make batch updates using a single statement with several
sets of input parameters, follow these basic steps:
Disable AutoCommit for the Connection object.
Invoke the prepareStatement method to create a
PreparedStatement object for the SQL statement with input
parameters.
For each set of input parameter values:
Execute setXXX methods to assign values to the input
parameters.
Invoke the addBatch method to add the set of input
parameters to the batch.
Invoke the executeBatch method to execute the statements
with all sets of parameters.
Check for errors. If no errors occurred:
Get the number of rows that were updated by each execution
of the SQL statement from the array that the executeBatch
invocation returns.
Invoke the commit method to commit the changes.
| Is This Answer Correct ? | 1 Yes | 0 No |
How can we store the file in the oracle database?
What is transaction processing in jdbc?
Where jdbc drivermanager class is used?
Which is better jpa or jdbc?
What is db client?
Name different methods for getting streams.
i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
What are jdbc and its components?
Explain how to make updates to the updatable resultsets.
How can you retrieve data from the resultset using jdbc?
Hi to all.. well i want to make a standalone application which can use the concept of connection pooling, constraint is that i have not to use any application server like weblogic etc. Please help me out. Thaks in advance.
What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?