【正文】
support updating columns of these types, including updating the ARRAY type as well JDBC 新功能 Retrieving autogenerated keys Listing 1. Retrieving an autogenerated key Statement stmt = ()。 // Obtain the generated key that results from the query. (INSERT INTO authors + (first_name, last_name) + VALUES (39。Gee39。, 39。Orwell39。), )。 ResultSet rs = ()。 if ( () ) { // Retrieve the auto generated key(s). int key = (1)。 } JDBC 新功能 Returning multiple results Listing 2. How to handle multiple open results String procCall = 。 // Set the value of procCall to call a stored procedure. // ... CallableStatement cstmt = (procCall)。 boolean retval = ()。 if (retval == false) { // The statement returned an update count, so handle it. // ... } else { // ResultSet JDBC 新功能 Returning multiple results ResultSet rs1 = ()。 // ... retval = (ULT)。 if (retval == true) { ResultSet rs2 = ()。 // Both ResultSets are open and ready for use. ()。 ()。 // ... }} JDBC 新功能 Prepared statement pooling ? In addition to improved connection pool support, it is now possible to pool prepared statements. A prepared statement allows you to take a monly used SQL statement and prepile it, thereby dramatically improving performance if the statement is executed multiple times. JDBC 新功能 Using savepoints in your transactions JDBC 新功能 Prepared statement pooling Listing 4. Using savepoints (false)。 // Set a conservative transaction isolation level. (BLE)。 Statement stmt = ()。 int rows = ( INSERT INTO authors + (first_name, last_name) VALUES + (39。Lewis39。, 39。Carroll39。))。 // Set a named savepoint. Savepoint svpt = (NewAuthor)。 // ... JDBC 新功能 Prepared statement pooling rows = ( UPDATE authors set type = 39。fiction39。 + WHERE last_name = 39。Carroll39。)。 // ... (svpt)。 // ... // The author has been added, but not updated. ()。 Q amp。 A