db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r169674 - /incubator/derby/docs/trunk/src/ref/crefjavstateautogen.dita
Date Wed, 11 May 2005 18:53:21 GMT
Author: jta
Date: Wed May 11 11:53:20 2005
New Revision: 169674

URL: http://svn.apache.org/viewcvs?rev=169674&view=rev
Applied Jeff Levitt's patch for DERBY-199


Modified: incubator/derby/docs/trunk/src/ref/crefjavstateautogen.dita
URL: http://svn.apache.org/viewcvs/incubator/derby/docs/trunk/src/ref/crefjavstateautogen.dita?rev=169674&r1=169673&r2=169674&view=diff
--- incubator/derby/docs/trunk/src/ref/crefjavstateautogen.dita (original)
+++ incubator/derby/docs/trunk/src/ref/crefjavstateautogen.dita Wed May 11 11:53:20 2005
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE concept PUBLIC "-//IBM//DTD DITA Concept//EN"
+ "../dtd/concept.dtd">
 Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.  
@@ -14,9 +16,6 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
-<!DOCTYPE concept PUBLIC "-//IBM//DTD DITA Concept//EN"
- "../dtd/concept.dtd">
 <concept id="crefjavstateautogen" xml:lang="en-us">
 <title>Autogenerated keys</title>
@@ -30,42 +29,18 @@
 feature, which allows users to create columns in tables for which the database
 system automatically assigns increasing integer values. In JDBC 3.0, the method <i>Statement.getGeneratedKeys</i>
 be called to retrieve the value of such a column. This method returns a <i>ResultSet</i>
-with a column for each automatically generated key. Calling <i>ResultSet.getMetaData</i>
-the <i>ResultSet</i> object returned by <i>getGeneratedKeys</i> produces
a <i>ResultSetMetaData</i> object
-that can be used to determine the number, type, and properties of the generated
-keys. A flag indicating that any auto-generated columns should be returned
-is passed to the methods <i>execute</i>, <i>executeUpdate</i>, or
<i>prepareStatement</i> when
+with a column for the automatically generated key. Calling <i>ResultSet.getMetaData</i>
+the <i>ResultSet</i> object returned by <i>getGeneratedKeys</i> produces
a <i>ResultSetMetaData</i> object that is similar to that returned by <xref
+A flag indicating that any auto-generated columns should be returned is passed
+to the methods <i>execute</i>, <i>executeUpdate</i>, or <i>prepareStatement</i>
 the statement is executed or prepared.</p>
 <p>Here's an example that returns a ResultSet with values for auto-generated
 columns in TABLE1:   <codeblock expanse="column"><b>Statement stmt = conn.createStatement();
 int rows = stmt.executeUpdate("INSERT INTO TABLE1 (C11, C12) VALUES (1,1)", Statement.RETURN_GENERATED_KEYS);
 ResultSet rs = stmt.getGeneratedKeys();</b></codeblock></p>
-<p>Additional methods allow you to specify the ordinals or names of the specific
-columns to be returned. An exception is thrown for invalid column or position
-<p>There are three ways of using Autogenerated Keys for insert statements.
-You can:  <ul>
-<li>Pass the flag Statement.RETURN_GENERATED_KEYS to <i>execute</i> or
<i>executeUpdate</i> method.</li>
-<li>Send an array of column names to <i>execute</i> or <i>executeUpdate</i>,
-so only those  column's values are returned by <i>getGeneratedKeys() resultset</i>.</li>
-<li>Send an array of column indexes to <i>execute</i> or <i>executeUpdate</i>.
-This array is an index of columns for the target table. </li>
-</ul>If the <i>Statement.RETURN_GENERATED_KEYS</i> flag is passed to the
<i>execute</i> or <i>executeUpdate</i> method,
-rather than the column positions/names list, <ph conref="refconrefs.dita#prod/productshortname"></ph>
-a ResultSet containing columns with default values (this includes autoincrement
-column). To obtain a specific column, pass the column positions/names array.
-If <i>Statement.getGeneratedKeys</i> is executed for a non-insert statement,
-an exception is thrown.</p>
-<p>The key indexes array in AutoGeneratedKey is an index of columns into the
-target table. You can send an array of column indexes to <i>execute</i> or <i>executeUpdate</i>.
-This array is an index of columns into the target table. For example: <codeblock>create
table t1(c11 int, c12 int);
-int[ ] colIndexes = new int[1];
-colIndexes[0] = 1;
-statment.execute("insert into t1(c12, c11) values (2,1)",colIndexes);
---- will return a resultset with column c11.</codeblock></p>
-<p>See the <cite><ph conref="refconrefs.dita#pub/citdevelop"></ph></cite>
-more information about arrays.</p>
+<p>To use Autogenerated Keys in INSERT statements, pass the <codeph>Statement.RETURN_GENERATED_KEYS</codeph>
+to the <i>execute</i> or <i>executeUpdate</i> method. <ph
+conref="refconrefs.dita#prod/productshortname"></ph> does not support passing column
names or column indexes to the <i>execute</i>, <i>executeUpdate</i>,
or <i>prepareStatement</i> methods.</p>
-<?Pub *0000003547?>
+<?Pub *0000003104?>

View raw message