db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r671940 [1/5] - in /db/derby/code/trunk: ./ java/stubs/ java/stubs/jsr169/ java/stubs/jsr169/java/ java/stubs/jsr169/java/sql/ java/stubs/jsr169/javax/ java/stubs/jsr169/javax/sql/ tools/ant/properties/
Date Thu, 26 Jun 2008 16:41:11 GMT
Author: rhillegas
Date: Thu Jun 26 09:41:10 2008
New Revision: 671940

URL: http://svn.apache.org/viewvc?rev=671940&view=rev
Log:
DERBY-3703: Add stub implementation of JSR169 so that the J2ME client will be built by default.

Added:
    db/derby/code/trunk/java/stubs/
    db/derby/code/trunk/java/stubs/jsr169/
    db/derby/code/trunk/java/stubs/jsr169/java/
    db/derby/code/trunk/java/stubs/jsr169/java/sql/
    db/derby/code/trunk/java/stubs/jsr169/java/sql/BatchUpdateException.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Blob.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/CallableStatement.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Clob.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Connection.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/DataTruncation.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/DatabaseMetaData.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Date.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/PreparedStatement.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/ResultSet.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/ResultSetMetaData.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/SQLException.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/SQLWarning.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Savepoint.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Statement.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Time.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Timestamp.java
    db/derby/code/trunk/java/stubs/jsr169/java/sql/Types.java
    db/derby/code/trunk/java/stubs/jsr169/javax/
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/DataSource.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSet.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetEvent.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetInternal.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetListener.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetMetaData.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetReader.java
    db/derby/code/trunk/java/stubs/jsr169/javax/sql/RowSetWriter.java
Modified:
    db/derby/code/trunk/NOTICE
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/tools/ant/properties/dirs.properties

Modified: db/derby/code/trunk/NOTICE
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/NOTICE?rev=671940&r1=671939&r2=671940&view=diff
==============================================================================
--- db/derby/code/trunk/NOTICE (original)
+++ db/derby/code/trunk/NOTICE Thu Jun 26 09:41:10 2008
@@ -29,3 +29,13 @@
 Software Acknowledgment and Redistribution document at
 http://www.itl.nist.gov/div897/ctg/sql_form.htm
 
+
+The JDBC api for small devices (under java/stubs/jsr169) was produced by
+trimming sources supplied by the Apache Harmony project. The following
+notice covers the Harmony sources:
+
+Portions of Harmony were originally developed by
+Intel Corporation and are licensed to the Apache Software
+Foundation under the "Software Grant and Corporate Contribution
+License Agreement", informally known as the "Intel Harmony CLA".
+

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?rev=671940&r1=671939&r2=671940&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Thu Jun 26 09:41:10 2008
@@ -28,6 +28,7 @@
   <!-- Compiler settings -->
   <property file="${properties.dir}/sane${sanity}.properties"/>
 
+
 <!-- Targets -->
 
   <target name="buildsource" depends="checkCompilerLevel,init,prebuild,setCompilerProperties,engine,storeless,tools,drda,client,build,versioninfo,localeinfo"/>
@@ -201,6 +202,12 @@
     <!-- Release and version info -->
     <property file="${properties.dir}/release.properties"/>
 
+    <!-- 
+            If the user hasn't already set this property, point it at our stub
+            implementation of JSR169.
+    -->
+    <property name="jsr169compile.classpath" value="${out.jsr169.dir}:${java14compile.classpath}"/>
+
   </target>
 
   <target name="setInitialProperties" if="dontAutosetProps"
@@ -438,7 +445,7 @@
     <ant dir="${derby.client.src.dir}"/>
   </target>
 
-  <target name="prebuild">
+  <target name="prebuild" depends="jsr169stubs">
     <ant dir="${derby.build.src.dir}/org/apache/derbyPreBuild"/>
   </target>
 
@@ -570,6 +577,33 @@
   </target>
 
 <!-- =================================================================== -->
+<!--                     Build the stub implementation of JSR169                  -->
+<!-- =================================================================== -->
+  <target name="jsr169stubs">
+    <mkdir dir="${out.stubs.dir}"/>
+    <mkdir dir="${out.jsr169.dir}"/>
+
+    <javac
+      source="1.4"
+      target="1.4"
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}"
+      srcdir="${derby.jsr169.src.dir}"
+      destdir="${out.jsr169.dir}">
+      <classpath>
+        <pathelement path="${compile.classpath}"/>
+      </classpath>
+     </javac>
+
+  </target>
+
+<!-- =================================================================== -->
 <!--                     Remove generated message files                   -->
 <!-- =================================================================== -->
   <target name="cleanmessages">

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/BatchUpdateException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/BatchUpdateException.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/BatchUpdateException.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/BatchUpdateException.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,147 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.io.Serializable;
+
+/**
+ * An exception thrown if a problem occurs during a batch update operation.
+ * <p>
+ * A BatchUpdateException provides additional information about the problem that
+ * occurred, compared with a standard SQLException. It supplies update counts
+ * for successful commands that executed within the batch update, but before the
+ * exception was encountered.
+ * <p>
+ * The element order in the array of update counts matches the order that the
+ * commands were added to the batch operation.
+ * <p>
+ * Once a batch update command fails and a BatchUpdateException is thrown, the
+ * JDBC driver may continue processing the remaining commands in the batch. If
+ * the driver does process more commands after the problem occurs, the array
+ * returned by BatchUpdateException.getUpdateCounts has an element for every
+ * command in the batch, not only those that executed successfully. In this
+ * case, the array element for any command which encountered a problem is set to
+ * Statement.EXECUTE_FAILED.
+ */
+public class BatchUpdateException extends SQLException implements Serializable {
+
+    private static final long serialVersionUID = 5977529877145521757L;
+
+    private int[] updateCounts = null;
+
+    /**
+     * Creates a BatchUpdateException with the Reason, SQLState, and Update
+     * Counts set to null and a Vendor Code of 0.
+     */
+    public BatchUpdateException() {
+        super();
+    }
+
+    /**
+     * Creates a BatchUpdateException with the Update Counts set to the supplied
+     * value and the Reason, SQLState set to null and a Vendor Code of 0.
+     * 
+     * @param updateCounts
+     *            the array of Update Counts to use in initialization
+     */
+    public BatchUpdateException(int[] updateCounts) {
+        super();
+        this.updateCounts = updateCounts;
+    }
+
+    /**
+     * Creates a BatchUpdateException with the Update Counts set to the supplied
+     * value, the Reason set to the supplied value and SQLState set to null and
+     * a Vendor Code of 0.
+     * 
+     * @param reason
+     *            the initialization value for Reason
+     * @param updateCounts
+     *            the array of Update Counts to set
+     */
+    public BatchUpdateException(String reason, int[] updateCounts) {
+        super(reason);
+        this.updateCounts = updateCounts;
+    }
+
+    /**
+     * Creates a BatchUpdateException with the Update Counts set to the supplied
+     * value, the Reason set to the supplied value, the SQLState initialized to
+     * the supplied value and the Vendor Code initialized to 0.
+     * 
+     * @param reason
+     *            the value to use for the Reason
+     * @param SQLState
+     *            the X/OPEN value to use for the SQLState
+     * @param updateCounts
+     *            the array of Update Counts to set
+     */
+    public BatchUpdateException(String reason, String SQLState,
+            int[] updateCounts) {
+        super(reason, SQLState);
+        this.updateCounts = updateCounts;
+    }
+
+    /**
+     * Creates a BatchUpdateException with the Update Counts set to the supplied
+     * value, the Reason set to the supplied value, the SQLState initialized to
+     * the supplied value and the Vendor Code set to the supplied value.
+     * 
+     * @param reason
+     *            the value to use for the Reason
+     * @param SQLState
+     *            the X/OPEN value to use for the SQLState
+     * @param vendorCode
+     *            the value to use for the vendor error code
+     * @param updateCounts
+     *            the array of Update Counts to set
+     */
+    public BatchUpdateException(String reason, String SQLState, int vendorCode,
+            int[] updateCounts) {
+        super(reason, SQLState, vendorCode);
+        this.updateCounts = updateCounts;
+    }
+
+    /**
+     * Gets the Update Counts array.
+     * <p>
+     * If a batch update command fails and a BatchUpdateException is thrown, the
+     * JDBC driver may continue processing the remaining commands in the batch.
+     * If the driver does process more commands after the problem occurs, the
+     * array returned by <code>BatchUpdateException.getUpdateCounts</code> has
+     * an element for every command in the batch, not only those that executed
+     * successfully. In this case, the array element for any command which
+     * encountered a problem is set to Statement.EXECUTE_FAILED.
+     * 
+     * @return an array that contains the successful update counts, before this
+     *         exception. Alternatively, if the driver continues to process
+     *         commands following an error, one of these listed items for every
+     *         command the batch contains:
+     *         <ol>
+     *         <li>an count of the updates</li>
+     *         <li><code>Statement.SUCCESS_NO_INFO</code> indicating that the
+     *         command completed successfully, but the amount of altered rows is
+     *         not known.</li>
+     *         <li><code>Statement.EXECUTE_FAILED</code> indicating that the
+     *         command was unsuccessful.
+     *         </ol>
+     */
+    public int[] getUpdateCounts() {
+        return updateCounts;
+    }
+}

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/Blob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/Blob.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/Blob.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/Blob.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,160 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.io.OutputStream;
+import java.io.InputStream;
+
+/**
+ * A Java interface mapping for the SQL BLOB type.
+ * <p>
+ * An SQL CLOB type stores a large array of bytes (binary data) as the value in
+ * a column of a database.
+ * <p>
+ * The java.sql.Blob interface provides methods for setting and retrieving data
+ * in the Blob, for querying Clob data length, for searching for data within the
+ * Blob.
+ */
+public interface Blob {
+
+    /**
+     * Retrieves this Blob object as a binary stream.
+     * 
+     * @return a binary InputStream giving access to the Blob data
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public InputStream getBinaryStream() throws SQLException;
+
+    /**
+     * Gets a portion of the value of this Blob as an array of bytes.
+     * 
+     * @param pos
+     *            the position of the first byte in the Blob to get, where the
+     *            first byte in the Blob has position = 1
+     * @param length
+     *            the number of bytes to get
+     * @return a byte array containing the data from the Blob, starting at pos
+     *         and of length up to <code>length</code> bytes long
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public byte[] getBytes(long pos, int length) throws SQLException;
+
+    /**
+     * Gets the number of bytes in this Blob object.
+     * 
+     * @return an long value with the length of the Blob in bytes
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public long length() throws SQLException;
+
+    /**
+     * Search for the position in this Blob at which a specified pattern begins,
+     * starting at a specified position within the Blob.
+     * 
+     * @param pattern
+     *            a Blob containing the pattern of data to search for in this
+     *            Blob
+     * @param start
+     *            the position within this Blob to start the search, where the
+     *            first position in the Blob is 1
+     * @return a long value with the position at which the pattern begins. -1 if
+     *         the pattern is not found in this Blob.
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public long position(Blob pattern, long start) throws SQLException;
+
+    /**
+     * Search for the position in this Blob at which the specified pattern
+     * begins, starting at a specified position within the Blob.
+     * 
+     * @param pattern
+     *            a byte array containing the pattern of data to search for in
+     *            this Blob
+     * @param start
+     *            the position within this Blob to start the search, where the
+     *            first position in the Blob is 1
+     * @return a long value with the position at which the pattern begins. -1 if
+     *         the pattern is not found in this Blob.
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public long position(byte[] pattern, long start) throws SQLException;
+
+    /**
+     * Gets a stream that can be used to write binary data to this Blob.
+     * 
+     * @param pos
+     *            the position within this Blob at which to start writing, where
+     *            the first position in the Blob is 1
+     * @return a binary InputStream which can be used to write data into the
+     *         Blob starting at the specified position.
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public OutputStream setBinaryStream(long pos) throws SQLException;
+
+    /**
+     * Writes a specified array of bytes to this Blob. object, starting at a
+     * specified position. Returns the number of bytes written.
+     * 
+     * @param pos
+     *            the position within this Blob at which to start writing, where
+     *            the first position in the Blob is 1
+     * @param theBytes
+     *            an array of bytes to write into the Blob
+     * @return an integer containing the number of bytes written to the Blob
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public int setBytes(long pos, byte[] theBytes) throws SQLException;
+
+    /**
+     * Writes a portion of a specified byte array to this Blob. Returns the
+     * number of bytes written.
+     * 
+     * @param pos
+     *            the position within this Blob at which to start writing, where
+     *            the first position in the Blob is 1
+     * @param theBytes
+     *            an array of bytes to write into the Blob
+     * @param offset
+     *            the offset into the byte array from which to start writing
+     *            data - the first byte in the array has offset 0.
+     * @param len
+     *            the length of data to write, as the number of bytes
+     * @return an integer containing the number of bytes written to the Blob
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public int setBytes(long pos, byte[] theBytes, int offset, int len)
+            throws SQLException;
+
+    /**
+     * Truncate the value of this Blob object to a specified length in bytes.
+     * 
+     * @param len
+     *            the length of data in bytes to truncate the value of this Blob
+     * @throws SQLException
+     *             if an error occurs accessing the Blob
+     */
+    public void truncate(long len) throws SQLException;
+}

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/CallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/CallableStatement.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/CallableStatement.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/CallableStatement.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,404 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Map;
+import java.net.URL;
+import java.io.InputStream;
+import java.io.Reader;
+
+/**
+ * An interface used to call Stored Procedures.
+ * <p>
+ * The JDBC API provides an SQL escape syntax allowing Stored Procedures to be
+ * called in a standard way for all databases. The JDBC escape syntax has two
+ * forms. One form includes a result parameter. The second form does not include
+ * a result parameter. Where the result parameter is used, it must be declared
+ * as an OUT parameter. Other parameters can be declared as IN, OUT or INOUT.
+ * Parameters are referenced either by name or by a numerical index, with the
+ * first parameter being 1, the second 1 and so on. Here are examples of the two
+ * forms of the escape syntax: <code>
+ * 
+ * { ?= call &lt.procedurename&gt.[([parameter1,parameter2,...])]}
+ * 
+ * {call &lt.procedurename&gt.[([parameter1,parameter2,...])]}
+ * </code>
+ * <p>
+ * IN parameters are set before calling the procedure, using the setter methods
+ * which are inherited from <code>PreparedStatement</code>. For OUT
+ * parameters, their Type must be registered before executing the stored
+ * procedure, and the value is retrieved using the getter methods defined in the
+ * CallableStatement interface.
+ * <p>
+ * CallableStatements can return one or more ResultSets. Where multiple
+ * ResultSets are returned they are accessed using the methods inherited from
+ * the <code>Statement</code> interface.
+ */
+public interface CallableStatement extends PreparedStatement {
+
+    /**
+     * Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a java.sql.Blob with the value. null if the value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Blob getBlob(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC BIT parameter as a boolean
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a boolean representing the parameter value. false if the value is
+     *         SQL NULL
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public boolean getBoolean(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC TINYINT parameter as a byte
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a byte with the value of the parameter. 0 if the value is SQL
+     *         NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public byte getByte(int parameterIndex) throws SQLException;
+
+    /**
+     * Returns a byte array representation of the indexed JDBC
+     * <code>BINARY</code> or <code>VARBINARY</code> parameter.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return an array of bytes with the value of the parameter. null if the
+     *         value is SQL NULL.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public byte[] getBytes(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a java.sql.Clob with the value of the parameter. null if the
+     *         value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Clob getClob(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return the java.sql.Date with the parameter value. null if the value is
+     *         SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Date getDate(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC DATE parameter as a java.sql.Date.,
+     * using a specified Calendar to construct the date.
+     * <p>
+     * The JDBC driver uses the Calendar to create the Date using a particular
+     * timezone and locale. Default behaviour of the driver is to use the Java
+     * virtual machine default settings.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param cal
+     *            the Calendar to use to construct the Date
+     * @return the java.sql.Date with the parameter value. null if the value is
+     *         SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Date getDate(int parameterIndex, Calendar cal) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC DOUBLE parameter as a double
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return the double with the parameter value. 0.0 if the value is SQL
+     *         NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public double getDouble(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC FLOAT parameter as a float
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return the float with the parameter value. 0.0 if the value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public float getFloat(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC INTEGER parameter as an int
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return the int with the parameter value. 0 if the value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public int getInt(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC BIGINT parameter as a long
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return the long with the parameter value. 0 if the value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public long getLong(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified parameter as a Java <code>Object</code>.
+     * <p>
+     * The object type returned is the JDBC type registered for the parameter
+     * with a <code>registerOutParameter</code> call. If a parameter was
+     * registered as a <code>java.sql.Types.OTHER</code> then it may hold
+     * abstract types that are particular to the connected database.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return an Object holding the value of the parameter.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Object getObject(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC SMALLINT parameter as a short
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a short with the parameter value. 0 if the value is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public short getShort(int parameterIndex) throws SQLException;
+
+    /**
+     * Returns the indexed parameter's value as a string. The parameter value
+     * must be one of the JDBC types <code>CHAR</code>, <code>VARCHAR</code>
+     * or <code>LONGVARCHAR</code>.
+     * <p>
+     * The string corresponding to a <code>CHAR</code> of fixed length will be
+     * of identical length to the value in the database inclusive of padding
+     * characters.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a String with the parameter value. null if the value is SQL NULL.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public String getString(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC TIME parameter as a java.sql.Time.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a java.sql.Time with the parameter value. null if the value is
+     *         SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Time getTime(int parameterIndex) throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC TIME parameter as a java.sql.Time,
+     * using the supplied Calendar to construct the time. The JDBC driver uses
+     * the Calendar to handle specific timezones and locales when creating the
+     * Time.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param cal
+     *            the Calendar to use in constructing the Time.
+     * @return a java.sql.Time with the parameter value. null if the value is
+     *         SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Time getTime(int parameterIndex, Calendar cal) throws SQLException;
+
+    /**
+     * Returns the indexed parameter's <code>TIMESTAMP</code> value as a
+     * <code>java.sql.Timestamp</code>.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a new <code>java.sql.Timestamp</code> with the parameter value.
+     *         A <code>null</code> reference is returned for an SQL value of
+     *         <code>NULL</code>
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Timestamp getTimestamp(int parameterIndex) throws SQLException;
+
+    /**
+     * Returns the indexed parameter's <code>TIMESTAMP</code> value as a
+     * <code>java.sql.Timestamp</code>. The JDBC driver uses the supplied
+     * <code>Calendar</code> to handle specific timezones and locales when
+     * creating the result.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param cal
+     *            used for creating the returned <code>Timestamp</code>
+     * @return a new <code>java.sql.Timestamp</code> with the parameter value.
+     *         A <code>null</code> reference is returned for an SQL value of
+     *         <code>NULL</code>
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public Timestamp getTimestamp(int parameterIndex, Calendar cal)
+            throws SQLException;
+
+    /**
+     * Gets the value of a specified JDBC DATALINK parameter as a java.net.URL.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @return a java.sql.Datalink with the parameter value. null if the value
+     *         is SQL NULL.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public URL getURL(int parameterIndex) throws SQLException;
+
+    /**
+     * Defines the Type of a specified OUT parameter. All OUT parameters must
+     * have their Type defined before a stored procedure is executed.
+     * <p>
+     * The Type defined by this method fixes the Java type that must be
+     * retrieved using the getter methods of CallableStatement. If a database
+     * specific type is expected for a parameter, the Type java.sql.Types.OTHER
+     * should be used. Note that there is another variant of this method for
+     * User Defined Types or a REF type.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param sqlType
+     *            the JDBC type as defined by java.sql.Types. The JDBC types
+     *            NUMERIC and DECIMAL should be defined using the version of
+     *            <code>registerOutParameter</code> that takes a
+     *            <code>scale</code> parameter.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public void registerOutParameter(int parameterIndex, int sqlType)
+            throws SQLException;
+
+    /**
+     * Defines the Type of a specified OUT parameter. All OUT parameters must
+     * have their Type defined before a stored procedure is executed. This
+     * version of the registerOutParameter method, which has a scale parameter,
+     * should be used for the JDBC types NUMERIC and DECIMAL, where there is a
+     * need to specify the number of digits expected after the decimal point.
+     * <p>
+     * The Type defined by this method fixes the Java type that must be
+     * retrieved using the getter methods of CallableStatement.
+     * 
+     * @param parameterIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param sqlType
+     *            the JDBC type as defined by java.sql.Types.
+     * @param scale
+     *            the number of digits after the decimal point. Must be greater
+     *            than or equal to 0.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public void registerOutParameter(int parameterIndex, int sqlType, int scale)
+            throws SQLException;
+
+    /**
+     * Defines the Type of a specified OUT parameter. This variant of the method
+     * is designed for use with parameters that are User Defined Types (UDT) or
+     * a REF type, although it can be used for any type.
+     * 
+     * @param paramIndex
+     *            the parameter number index, where the first parameter has
+     *            index 1
+     * @param sqlType
+     *            a JDBC type expressed as a constant from {@link Types}
+     * @param typeName
+     *            an SQL type name. For a REF type, this name should be the
+     *            fully qualified name of the referenced type.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public void registerOutParameter(int paramIndex, int sqlType,
+            String typeName) throws SQLException;
+
+    /**
+     * Gets whether the value of the last OUT parameter read was SQL NULL.
+     * 
+     * @return true if the last parameter was SQL NULL, false otherwise.
+     * @throws SQLException
+     *             if a database error happens
+     */
+    public boolean wasNull() throws SQLException;
+}

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/Clob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/Clob.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/Clob.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/Clob.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,174 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * A Java interface mapping for the SQL CLOB type.
+ * <p>
+ * An SQL CLOB type stores a large array of characters as the value in a column
+ * of a database.
+ * <p>
+ * The java.sql.Clob interface provides methods for setting and retrieving data
+ * in the Clob, for querying Clob data length, for searching for data within the
+ * Clob.
+ */
+public interface Clob {
+
+    /**
+     * Gets the value of this Clob object as an ASCII stream.
+     * 
+     * @return an ASCII InputStream giving access to the Clob data
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public InputStream getAsciiStream() throws SQLException;
+
+    /**
+     * Gets the value of this Clob object as a java.io.Reader.
+     * 
+     * @return a character stream Reader object giving access to the Clob data
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public Reader getCharacterStream() throws SQLException;
+
+    /**
+     * Gets a copy of a specified substring in this Clob.
+     * 
+     * @param pos
+     *            the index of the start of the substring in the Clob
+     * @param length
+     *            the length of the data to retrieve
+     * @return A String containing the requested data
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public String getSubString(long pos, int length) throws SQLException;
+
+    /**
+     * Retrieves the number of characters in this Clob object.
+     * 
+     * @return a long value with the number of character in this Clob.
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public long length() throws SQLException;
+
+    /**
+     * Retrieves the character position at which a specified Clob object appears
+     * in this Clob object.
+     * 
+     * @param searchstr
+     *            the specified Clob to search for
+     * @param start
+     *            the position within this Clob to start the search
+     * @return a long value with the position at which the specified Clob occurs
+     *         within this Clob.
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public long position(Clob searchstr, long start) throws SQLException;
+
+    /**
+     * Retrieves the character position at which a specified substring appears
+     * in this Clob object.
+     * 
+     * @param searchstr
+     *            th String to search for
+     * @param start
+     *            the position at which to start the search within this Clob.
+     * @return a long value with the position at which the specified String
+     *         occurs within this Clob.
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public long position(String searchstr, long start) throws SQLException;
+
+    /**
+     * Retrieves a stream which can be used to write Ascii characters to this
+     * Clob object, starting at specified position.
+     * 
+     * @param pos
+     *            the position at which to start the writing
+     * @return an OutputStream which can be used to write ASCII characters to
+     *         this Clob.
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public OutputStream setAsciiStream(long pos) throws SQLException;
+
+    /**
+     * Retrieves a stream which can be used to write a stream of Unicode
+     * characters to this Clob object, at a specified position.
+     * 
+     * @param pos
+     *            the position at which to start the writing
+     * @return a Writer which can be used to write Unicode characters to this
+     *         Clob.
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public Writer setCharacterStream(long pos) throws SQLException;
+
+    /**
+     * Writes a given Java String to this Clob object at a specified position.
+     * 
+     * @param pos
+     *            the position at which to start the writing
+     * @param str
+     *            the String to write
+     * @return the number of characters written
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public int setString(long pos, String str) throws SQLException;
+
+    /**
+     * Writes len characters of String, starting at a specified character
+     * offset, to this Clob.
+     * 
+     * @param pos
+     *            the position at which to start the writing
+     * @param str
+     *            the String to write
+     * @param offset
+     *            the offset within str to start writing from
+     * @param len
+     *            the number of characters to write
+     * @return the number of characters written
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public int setString(long pos, String str, int offset, int len)
+            throws SQLException;
+
+    /**
+     * Truncates this Clob to have a specified length of characters.
+     * 
+     * @param len
+     *            the length in characters to truncate this Clob
+     * @throws SQLException
+     *             if an error occurs accessing the Clob
+     */
+    public void truncate(long len) throws SQLException;
+}

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/Connection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/Connection.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/Connection.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/Connection.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,737 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.util.Map;
+
+/**
+ * A Connection represents a link from a Java application to a database. All SQL
+ * statements and results are returned within the context of a connection.
+ * 
+ */
+public interface Connection {
+
+    /**
+     * A constant indicating that transactions are not supported.
+     */
+    public static final int TRANSACTION_NONE = 0;
+
+    /**
+     * No dirty reads are permitted. Transactions may not read a row containing
+     * changes that have not yet been committed.
+     */
+    public static final int TRANSACTION_READ_COMMITTED = 2;
+
+    /**
+     * Dirty reads (reading from table rows containing changes that have not yet
+     * been committed), non-repeatable reads (reading table rows more than once
+     * in a transaction but getting back different data because other
+     * transactions may have altered rows between reads), and phantom reads
+     * (retrieving additional "phantom" rows in the course of repeated table
+     * reads because other transactions may have inserted additional rows that
+     * satisfy an SQL <code>WHERE</code> clause) are <b>all permitted</b>.
+     */
+    public static final int TRANSACTION_READ_UNCOMMITTED = 1;
+
+    /**
+     * A constant indicating that dirty reads and non-repeatable reads are
+     * prevented; phantom reads can occur.
+     */
+    public static final int TRANSACTION_REPEATABLE_READ = 4;
+
+    /**
+     * Dirty reads (reading from table rows containing changes that have not yet
+     * been committed), non-repeatable reads (reading table rows more than once
+     * in a transaction but getting back different data because other
+     * transactions may have altered rows between reads), and phantom reads
+     * (retrieving additional "phantom" rows in the course of repeated table
+     * reads because other transactions may have inserted additional rows that
+     * satisfy an SQL <code>WHERE</code> clause) are <b>all prevented</b>.
+     */
+    public static final int TRANSACTION_SERIALIZABLE = 8;
+
+    /**
+     * Throws away any warnings that may have arisen for this connection.
+     * Subsequent calls to {@link #getWarnings()} will return <code>null</code>
+     * up until a brand new warning condition occurs.
+     * 
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void clearWarnings() throws SQLException;
+
+    /**
+     * Causes the instant release of all database and driver connection
+     * resources associated with this object. Any subsequent invocations of this
+     * method will have no effect.
+     * <p>
+     * It is strongly recommended that all Connections are closed before they
+     * are dereferenced by the application ready for garbage collection. While
+     * the finalize method of the Connection will close the Connection before
+     * garbage collection takes place, it is not advisable to leave the close
+     * operation to take place in this way. Unpredictable performance may result
+     * from closing Connections in the finalizer.
+     * 
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void close() throws SQLException;
+
+    /**
+     * Commits all of the changes made subsequent to the last commit or rollback
+     * of the associated transaction. All locks in the database held by this
+     * connection are also relinquished. Calling this operation on connection
+     * objects in auto-commit mode is an error.
+     * 
+     * @throws SQLException
+     *             if there is a problem accessing the database or if the target
+     *             connection instance is in auto-commit mode.
+     */
+    public void commit() throws SQLException;
+
+    /**
+     * Returns a new instance of <code>Statement</code> for issuing SQL
+     * commands to the remote database.
+     * <p>
+     * ResultSets generated by the returned Statement will default to type
+     * <code>TYPE_FORWARD_ONLY</code> and concurrency level
+     * <code>CONCUR_READ_ONLY</code>.
+     * 
+     * @return a <code>Statement</code> object with default settings.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Statement createStatement() throws SQLException;
+
+    /**
+     * Returns a new instance of <code>Statement</code> whose associated
+     * <code>ResultSet</code>s will have the characteristics specified in the
+     * type, concurrency and holdability arguments.
+     * 
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            </ul>
+     * @return a new instance of <code>Statement</code> capable of
+     *         manufacturing <code>ResultSet</code>s that satisfy the
+     *         specified <code>resultSetType</code> and
+     *         <code>resultSetConcurrency</code> values.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Statement createStatement(int resultSetType, int resultSetConcurrency)
+            throws SQLException;
+
+    /**
+     * Returns a new instance of <code>Statement</code> whose associated
+     * <code>ResultSet</code>s will have the characteristics specified in the
+     * type, concurrency and holdability arguments.
+     * 
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            </ul>
+     * @param resultSetHoldability
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+     *            <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}
+     *            </ul>
+     * @return a new instance of <code>Statement</code> capable of
+     *         manufacturing <code>ResultSet</code>s that satisfy the
+     *         specified <code>resultSetType</code>,
+     *         <code>resultSetConcurrency</code> and
+     *         <code>resultSetHoldability</code> values.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Statement createStatement(int resultSetType,
+            int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException;
+
+    /**
+     * Returns a boolean indication of whether or not this connection is in the
+     * auto-commit operating mode.
+     * 
+     * @return <code>true</code> if auto-commit is on, otherwise
+     *         <code>false</code>
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public boolean getAutoCommit() throws SQLException;
+
+    /**
+     * Gets this Connection object's current catalog name.
+     * 
+     * @return the catalog name. <code>null</code> if there is no catalog
+     *         name.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public String getCatalog() throws SQLException;
+
+    /**
+     * Returns the kind of holdability that any <code>ResultSet</code>s made
+     * from this instance will have.
+     * 
+     * @return one of :
+     *         <ul>
+     *         <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+     *         <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}
+     *         </ul>
+     * @throws SQLException
+     *             if there is a problem accessing the a database
+     */
+    public int getHoldability() throws SQLException;
+
+    /**
+     * Gets the metadata about the database referenced by this connection. The
+     * returned <code>DatabaseMetaData</code> describes the database
+     * topography, available stored procedures, SQL syntax and so on.
+     * 
+     * @return a <code>DatabaseMetaData</code> object containing the database
+     *         description
+     * @throws SQLException
+     *             if there is a problem accessing the a database
+     */
+    public DatabaseMetaData getMetaData() throws SQLException;
+
+    /**
+     * Returns the present value of transaction isolation for this Connection
+     * instance.
+     * 
+     * @return the transaction isolation value
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     * @see #TRANSACTION_NONE
+     * @see #TRANSACTION_READ_COMMITTED
+     * @see #TRANSACTION_READ_UNCOMMITTED
+     * @see #TRANSACTION_REPEATABLE_READ
+     * @see #TRANSACTION_SERIALIZABLE
+     */
+    public int getTransactionIsolation() throws SQLException;
+
+    /**
+     * Gets the first instance of any <code>SQLWarning</code> objects that may
+     * have been created in the use of this connection. If at least one warning
+     * has occurred then this operation returns the first one reported. A
+     * <code>null</code> indicates that no warnings have occurred.
+     * <p>
+     * By invoking the {@link SQLWarning#getNextWarning()} method of the
+     * returned <code>SQLWarning</code> object it is possible to obtain all
+     * warning objects.
+     * 
+     * @return the first warning as an SQLWarning object (may be
+     *         <code>null</code>)
+     * @throws SQLException
+     *             if there is a problem accessing the database or if the call
+     *             has been made on a connection which has been previously
+     *             closed.
+     */
+    public SQLWarning getWarnings() throws SQLException;
+
+    /**
+     * Returns a boolean indication of whether or not this connection is in the
+     * closed state. The closed state may be entered into as a consequence of a
+     * successful invocation of the {@link #close()} method or else if an error
+     * has occurred that prevents the connection from functioning normally.
+     * 
+     * @return <code>true</code> if closed, otherwise <code>false</code>
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public boolean isClosed() throws SQLException;
+
+    /**
+     * Returns a boolean indication of whether or not this connection is
+     * currently in read-only state.
+     * 
+     * @return <code>true</code> if in read-only state, otherwise
+     *         <code>false</code>.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public boolean isReadOnly() throws SQLException;
+
+    /**
+     * Returns a string representation of the input SQL statement
+     * <code>sql</code> expressed in the underlying system's native SQL
+     * syntax.
+     * 
+     * @param sql
+     *            the JDBC form of an SQL statement.
+     * @return the SQL statement in native database format.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public String nativeSQL(String sql) throws SQLException;
+
+    /**
+     * Returns a new instance of <code>CallableStatement</code> that may be
+     * used for making stored procedure calls to the database.
+     * 
+     * @param sql
+     *            the SQL statement that calls the stored function
+     * @return a new instance of <code>CallableStatement</code> representing
+     *         the SQL statement. <code>ResultSet</code>s emitted from this
+     *         <code>CallableStatement</code> will default to type
+     *         {@link ResultSet#TYPE_FORWARD_ONLY} and concurrency
+     *         {@link ResultSet#CONCUR_READ_ONLY}.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public CallableStatement prepareCall(String sql) throws SQLException;
+
+    /**
+     * Returns a new instance of <code>CallableStatement</code> that may be
+     * used for making stored procedure calls to the database.
+     * <code>ResultSet</code>s emitted from this
+     * <code>CallableStatement</code> will satisfy the specified
+     * <code>resultSetType</code> and <code>resultSetConcurrency</code>
+     * values.
+     * 
+     * @param sql
+     *            the SQL statement
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            </ul>
+     * @return a new instance of <code>CallableStatement</code> representing
+     *         the precompiled SQL statement. <code>ResultSet</code>s emitted
+     *         from this <code>CallableStatement</code> will satisfy the
+     *         specified <code>resultSetType</code> and
+     *         <code>resultSetConcurrency</code> values.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public CallableStatement prepareCall(String sql, int resultSetType,
+            int resultSetConcurrency) throws SQLException;
+
+    /**
+     * Returns a new instance of <code>CallableStatement</code> that may be
+     * used for making stored procedure calls to the database. ResultSets
+     * created from this <code>CallableStatement</code> will have
+     * characteristics determined by the specified type, concurrency and
+     * holdability arguments.
+     * 
+     * @param sql
+     *            the SQL statement
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            </ul>
+     * @param resultSetHoldability
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+     *            <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}
+     *            </ul>
+     * @return a new instance of <code>CallableStatement</code> representing
+     *         the precompiled SQL statement. <code>ResultSet</code>s emitted
+     *         from this <code>CallableStatement</code> will satisfy the
+     *         specified <code>resultSetType</code>,
+     *         <code>resultSetConcurrency</code> and
+     *         <code>resultSetHoldability</code> values.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public CallableStatement prepareCall(String sql, int resultSetType,
+            int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException;
+
+    /**
+     * Returns a new instance of <code>PreparedStatement</code> that may be
+     * used any number of times to execute parameterized requests on the
+     * database server.
+     * <p>
+     * Subject to JDBC driver support, this operation will attempt to send the
+     * precompiled version of the statement to the database. Alternatively, if
+     * the driver is not capable of flowing precompiled statements, the
+     * statement will not reach the database server until it is executed. This
+     * will have a bearing on precisely when <code>SQLException</code>
+     * instances get raised.
+     * <p>
+     * By default, ResultSets from the returned object will be
+     * {@link ResultSet#TYPE_FORWARD_ONLY} type with a
+     * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency.
+     * 
+     * @param sql
+     *            the SQL statement.
+     * @return the PreparedStatement containing the supplied SQL statement
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql) throws SQLException;
+
+    /**
+     * Creates a default PreparedStatement that can retrieve automatically
+     * generated keys. Parameter <code>autoGeneratedKeys</code> may be used to
+     * specify to the driver if such keys should be made accessible. This is
+     * only the case when <code>sql</code> is an insert statement.
+     * <p>
+     * An SQL statement which may have IN parameters can be stored and
+     * precompiled in a PreparedStatement. The PreparedStatement can then be
+     * used to execute the statement multiple times in an efficient way.
+     * <p>
+     * Subject to JDBC driver support, this operation will attempt to send the
+     * precompiled version of the statement to the database. Alternatively, if
+     * the driver is not capable of flowing precompiled statements, the
+     * statement will not reach the database server until it is executed. This
+     * will have a bearing on precisely when <code>SQLException</code>
+     * instances get raised.
+     * <p>
+     * By default, ResultSets from the returned object will be
+     * {@link ResultSet#TYPE_FORWARD_ONLY} type with a
+     * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency.
+     * 
+     * @param sql
+     *            the SQL statement.
+     * @param autoGeneratedKeys
+     *            one of :
+     *            <ul>
+     *            <li>{@link Statement#RETURN_GENERATED_KEYS}
+     *            <li>{@link Statement#NO_GENERATED_KEYS}
+     *            </ul>
+     * @return a new <code>PreparedStatement</code> instance representing the
+     *         input SQL statement.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
+            throws SQLException;
+
+    /**
+     * Creates a default PreparedStatement that can retrieve the auto-generated
+     * keys designated by a supplied array. If <code>sql</code> is an SQL
+     * <code>INSERT</code> statement, parameter <code>columnIndexes</code>
+     * is expected to hold the index values for each column in the statement's
+     * intended database table containing the autogenerated-keys of interest.
+     * Otherwise <code>columnIndexes</code> is ignored.
+     * <p>
+     * Subject to JDBC driver support, this operation will attempt to send the
+     * precompiled version of the statement to the database. Alternatively, if
+     * the driver is not capable of flowing precompiled statements, the
+     * statement will not reach the database server until it is executed. This
+     * will have a bearing on precisely when <code>SQLException</code>
+     * instances get raised.
+     * <p>
+     * By default, ResultSets from the returned object will be
+     * {@link ResultSet#TYPE_FORWARD_ONLY} type with a
+     * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency.
+     * 
+     * @param sql
+     *            the SQL statement.
+     * @param columnIndexes
+     *            the indexes of the columns for which auto-generated keys
+     *            should be made available.
+     * @return the PreparedStatement containing the supplied SQL statement
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
+            throws SQLException;
+
+    /**
+     * Creates a PreparedStatement that generates ResultSets with the specified
+     * values of <code>resultSetType</code> and
+     * <code>resultSetConcurrency</code>.
+     * 
+     * @param sql
+     *            the SQL statement. It can contain one or more '?' IN parameter
+     *            placeholders
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            </ul>
+     * @return a new instance of <code>PreparedStatement</code> containing the
+     *         SQL statement <code>sql</code>. <code>ResultSet</code>s
+     *         emitted from this <code>PreparedStatement</code> will satisfy
+     *         the specified <code>resultSetType</code> and
+     *         <code>resultSetConcurrency</code> values.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql, int resultSetType,
+            int resultSetConcurrency) throws SQLException;
+
+    /**
+     * Creates a PreparedStatement that generates ResultSets with the specified
+     * type, concurrency and holdability
+     * 
+     * @param sql
+     *            the SQL statement. It can contain one or more '?' IN parameter
+     *            placeholders
+     * @param resultSetType
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}
+     *            <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}
+     *            <li>{@link ResultSet#TYPE_FORWARD_ONLY}
+     *            </ul>
+     * @param resultSetConcurrency
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CONCUR_READ_ONLY}
+     *            <li>{@link ResultSet#CONCUR_UPDATABLE}
+     *            </ul>
+     * @param resultSetHoldability
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+     *            <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}
+     *            </ul>
+     * 
+     * @return a new instance of <code>PreparedStatement</code> containing the
+     *         SQL statement <code>sql</code>. <code>ResultSet</code>s
+     *         emitted from this <code>PreparedStatement</code> will satisfy
+     *         the specified <code>resultSetType</code>,
+     *         <code>resultSetConcurrency</code> and
+     *         <code>resultSetHoldability</code> values.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql, int resultSetType,
+            int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException;
+
+    /**
+     * Creates a default PreparedStatement that can retrieve the auto-generated
+     * keys designated by a supplied array. If <code>sql</code> is an SQL
+     * <code>INSERT</code> statement, <code>columnNames</code> is expected
+     * to hold the names of each column in the statement's associated database
+     * table containing the autogenerated-keys of interest. Otherwise
+     * <code>columnNames</code> is ignored.
+     * <p>
+     * Subject to JDBC driver support, this operation will attempt to send the
+     * precompiled version of the statement to the database. Alternatively, if
+     * the driver is not capable of flowing precompiled statements, the
+     * statement will not reach the database server until it is executed. This
+     * will have a bearing on precisely when <code>SQLException</code>
+     * instances get raised.
+     * <p>
+     * By default, ResultSets from the returned object will be
+     * {@link ResultSet#TYPE_FORWARD_ONLY} type with a
+     * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency.
+     * 
+     * @param sql
+     *            the SQL statement.
+     * @param columnNames
+     *            the names of the columns for which auto-generated keys should
+     *            be made available.
+     * @return the PreparedStatement containing the supplied SQL statement
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public PreparedStatement prepareStatement(String sql, String[] columnNames)
+            throws SQLException;
+
+    /**
+     * Releases <code>savepoint</code> from the present transaction. Once
+     * removed, the <code>Savepoint</code> is considered invalid and should
+     * not be referenced further.
+     * 
+     * @param savepoint
+     *            the object targeted for removal
+     * @throws SQLException
+     *             if there is a problem with accessing the database or if
+     *             <code>savepoint</code> is considered not valid in this
+     *             transaction.
+     */
+    public void releaseSavepoint(Savepoint savepoint) throws SQLException;
+
+    /**
+     * Rolls back all updates made so far in this transaction as well as
+     * relinquishing all acquired database locks. It is an error to invoke this
+     * operation when in auto-commit mode.
+     * 
+     * @throws SQLException
+     *             if there is a problem with the database or if the method is
+     *             called while in auto-commit mode of operation.
+     */
+    public void rollback() throws SQLException;
+
+    /**
+     * Undoes all changes made after the supplied Savepoint object was set. This
+     * method should only be used when auto-commit mode is disabled.
+     * 
+     * @param savepoint
+     *            the Savepoint to roll back to
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void rollback(Savepoint savepoint) throws SQLException;
+
+    /**
+     * Sets this connection's auto-commit mode on or off.
+     * <p>
+     * Putting a Connection into auto-commit mode means that all associated SQL
+     * statements will be run and committed in their own separate transactions.
+     * Alternatively, auto-commit set to off means that associated SQL
+     * statements get grouped into transactions that need to be completed by
+     * explicit calls to either the {@link #commit()} or {@link #rollback()}
+     * methods.
+     * <p>
+     * Auto-commit is the default mode for new connection instances.
+     * <p>
+     * When in this mode, commits will automatically occur upon successful SQL
+     * statement completion or upon successful completion of an execute.
+     * Statements are not considered successfully complete until all associated
+     * <code>ResultSet</code>s and output parameters have been obtained or
+     * closed.
+     * <p>
+     * Calling this operation during an uncommitted transaction will result in
+     * it being committed.
+     * 
+     * @param autoCommit
+     *            boolean indication of whether to put the target connection
+     *            into auto-commit mode (<code>true</code>) or not (<code>false</code>)
+     * 
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void setAutoCommit(boolean autoCommit) throws SQLException;
+
+    /**
+     * Sets the catalog name for this connection. This is used to select a
+     * subspace of the database for future work. If the driver does not support
+     * catalog names, this method is ignored.
+     * 
+     * @param catalog
+     *            the catalog name to use.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void setCatalog(String catalog) throws SQLException;
+
+    /**
+     * Sets the holdability of ResultSets created by this Connection.
+     * 
+     * @param holdability
+     *            one of :
+     *            <ul>
+     *            <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}
+     *            <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+     *            <li>
+     *            </ul>
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void setHoldability(int holdability) throws SQLException;
+
+    /**
+     * Sets this connection to read-only mode.
+     * <p>
+     * This serves as a hint to the driver, which can enable database
+     * optimizations.
+     * 
+     * @param readOnly
+     *            true to set the Connection to read only mode. false disables
+     *            read-only mode
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public void setReadOnly(boolean readOnly) throws SQLException;
+
+    /**
+     * Creates an unnamed Savepoint in the current transaction.
+     * 
+     * @return a Savepoint object for this savepoint.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Savepoint setSavepoint() throws SQLException;
+
+    /**
+     * Creates a named Savepoint in the current transaction.
+     * 
+     * @param name
+     *            the name to use for the new Savepoint.
+     * @return a Savepoint object for this savepoint.
+     * @throws SQLException
+     *             if there is a problem accessing the database
+     */
+    public Savepoint setSavepoint(String name) throws SQLException;
+
+    /**
+     * Sets the transaction isolation level for this Connection.
+     * <p>
+     * If this method is called during a transaction, the results are
+     * implementation defined.
+     * 
+     * @param level
+     *            the new transaction isolation level to use from the following
+     *            list of possible values :
+     *            <ul>
+     *            <li>{@link #TRANSACTION_READ_COMMITTED}
+     *            <li>{@link #TRANSACTION_READ_UNCOMMITTED}
+     *            <li>{@link #TRANSACTION_REPEATABLE_READ}
+     *            <li>{@link #TRANSACTION_SERIALIZABLE}
+     *            </ul>
+     * @throws SQLException
+     *             if there is a problem with the database or if the value of
+     *             <code>level</code> is not one of the expected constant
+     *             values.
+     */
+    public void setTransactionIsolation(int level) throws SQLException;
+
+}

Added: db/derby/code/trunk/java/stubs/jsr169/java/sql/DataTruncation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/stubs/jsr169/java/sql/DataTruncation.java?rev=671940&view=auto
==============================================================================
--- db/derby/code/trunk/java/stubs/jsr169/java/sql/DataTruncation.java (added)
+++ db/derby/code/trunk/java/stubs/jsr169/java/sql/DataTruncation.java Thu Jun 26 09:41:10 2008
@@ -0,0 +1,126 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.sql;
+
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown when a JDBC driver unexpectedly truncates a data
+ * value either when reading or when writing data.
+ * 
+ * The SQLState value for a <code>DataTruncation</code> is <code>01004</code>.
+ */
+public class DataTruncation extends SQLWarning implements Serializable {
+
+    private static final long serialVersionUID = 6464298989504059473L;
+
+    private int index = 0;
+
+    private boolean parameter = false;
+
+    private boolean read = false;
+
+    private int dataSize = 0;
+
+    private int transferSize = 0;
+
+    private static final String THE_REASON = "Data truncation"; //$NON-NLS-1$
+
+    private static final String THE_SQLSTATE = "01004"; //$NON-NLS-1$
+
+    private static final int THE_ERROR_CODE = 0;
+
+    /**
+     * Creates a DataTruncation. The Reason is set to "Data truncation", the
+     * ErrorCode is set to the SQLException default value and other fields are
+     * set to the values supplied on this method.
+     * 
+     * @param index
+     *            the Index value of the column value or parameter that was
+     *            truncated
+     * @param parameter
+     *            true if it was a Parameter value that was truncated, false
+     *            otherwise
+     * @param read
+     *            true if the truncation occurred on a read operation, false
+     *            otherwise
+     * @param dataSize
+     *            the original size of the truncated data
+     * @param transferSize
+     *            the size of the data after truncation
+     */
+    public DataTruncation(int index, boolean parameter, boolean read,
+            int dataSize, int transferSize) {
+        super(THE_REASON, THE_SQLSTATE, THE_ERROR_CODE);
+        this.index = index;
+        this.parameter = parameter;
+        this.read = read;
+        this.dataSize = dataSize;
+        this.transferSize = transferSize;
+    }
+
+    /**
+     * Gets the number of bytes of data that should have been read/written.
+     * 
+     * @return the number of bytes that should have been read or written. The
+     *         value may be set to -1 if the size is unknown.
+     */
+    public int getDataSize() {
+        return dataSize;
+    }
+
+    /**
+     * Gets the index of the column or of the parameter that was truncated.
+     * 
+     * @return the index number of the column or of the parameter.
+     */
+    public int getIndex() {
+        return index;
+    }
+
+    /**
+     * Gets whether the value truncated was a parameter value or a column value.
+     * 
+     * @return true if the value truncated was a Parameter value, false if it
+     *         was a column value
+     */
+    public boolean getParameter() {
+        return parameter;
+    }
+
+    /**
+     * Gets whether the value was truncated on a read operation or a write
+     * operation
+     * 
+     * @return true if the value was truncated on a read operation, false
+     *         otherwise.
+     */
+    public boolean getRead() {
+        return read;
+    }
+
+    /**
+     * Gets the number of bytes of data that was actually read or written
+     * 
+     * @return the number of bytes actually read/written. The value may be set
+     *         to -1 if the size is unknown.
+     */
+    public int getTransferSize() {
+        return transferSize;
+    }
+}



Mime
View raw message