diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
commit | dd828f42a5c83b4270d4fbf6fce2da1878f1e84a (patch) | |
tree | fdd4b68fa1020f2b6426034c94823419a7236200 /sql | |
parent | fdb2704414a9ed92394ada0d1395e4db86889465 (diff) | |
download | libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.zip libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.gz libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'sql')
87 files changed, 11753 insertions, 5177 deletions
diff --git a/sql/src/main/java/java/sql/Array.java b/sql/src/main/java/java/sql/Array.java index e1d903e..6113c46 100644 --- a/sql/src/main/java/java/sql/Array.java +++ b/sql/src/main/java/java/sql/Array.java @@ -20,112 +20,157 @@ package java.sql; import java.util.Map; /** - * A Java representation of the SQL ARRAY type. + * A Java representation of the SQL {@code ARRAY} type. + * + * @since Android 1.0 */ public interface Array { /** - * Retrieves the contents of the SQL ARRAY value as a Java array object. + * Retrieves the contents of the SQL {@code ARRAY} value as a Java array + * object. * * @return A Java array containing the elements of this Array * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public Object getArray() throws SQLException; /** - * Returns part of the SQL ARRAY associated with this Array, starting at a - * particular index and comprising up to count successive elements of the - * SQL array. + * Returns part of the SQL {@code ARRAY} associated with this array, + * starting at a particular {@code index} and comprising up to {@code count} + * successive elements of the SQL array. * * @param index + * the start position in the array where the values are + * retrieved. * @param count - * @return A Java array containing the subportion of elements of this Array + * the number of elements to retrieve. + * @return A Java array containing the desired set of elements from this Array * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public Object getArray(long index, int count) throws SQLException; /** - * Returns part of the SQL ARRAY associated with this Array, starting at a - * particular index and comprising up to count successive elements of the - * SQL array. + * Returns part of the SQL {@code ARRAY} associated with this array, + * starting at a particular {@code index} and comprising up to {@code count} + * successive elements of the SQL array. * * @param index + * the start position in the array where the values are + * retrieved. * @param count + * the number of elements to retrieve. * @param map - * @return A Java array containing the subportion of elements of this Array + * the map defining the correspondence between SQL type names + * and Java types. + * @return A Java array containing the desired set of elements from this Array * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException; /** - * Returns the SQL ARRAY associated with this Array. + * Returns the data from the underlying SQL {@code ARRAY} as a Java array. * * @param map - * @return A Java array containing the elements of this Array + * the map defining the correspondence between SQL type names + * and Java types. + * @return A Java array containing the elements of this array * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public Object getArray(Map<String, Class<?>> map) throws SQLException; /** - * Returns the JDBC type of the entries in this Array's associated array. + * Returns the JDBC type of the entries in this array's underlying + * SQL array. * - * @return An integer constant from the java.sql.Types class + * @return An integer constant from the {@code java.sql.Types} class * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public int getBaseType() throws SQLException; /** - * Returns the SQL type name of the entries in the array associated with - * this Array. + * Returns the SQL type name of the entries in this array's underlying + * SQL array. * * @return The database specific name or a fully-qualified SQL type name. * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public String getBaseTypeName() throws SQLException; /** - * Returns a ResultSet object which holds the entries of the SQL ARRAY - * associated with this Array. + * Returns a ResultSet object which holds the entries of the SQL {@code + * ARRAY} associated with this array. * - * @return the ResultSet + * @return the elements of the array as a {@code ResultSet}. * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public ResultSet getResultSet() throws SQLException; /** - * Returns a ResultSet object that holds the entries of a subarray, - * beginning at a particular index and comprising up to count successive - * entries. + * Returns a {@code ResultSet} object that holds the entries of a subarray, + * beginning at a particular index and comprising up to {@code count} + * successive entries. * * @param index + * the start position in the array where the values are + * retrieved. * @param count - * @return the ResultSet + * the number of elements to retrieve. + * @return the elements of the array as a {@code ResultSet}. * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public ResultSet getResultSet(long index, int count) throws SQLException; /** - * Returns a ResultSet object that holds the entries of a subarray, - * beginning at a particular index and comprising up to count successive - * entries. + * Returns a {@code ResultSet} object that holds the entries of a subarray, + * beginning at a particular index and comprising up to {@code count} + * successive entries. * * @param index + * the start position in the array where the values are + * retrieved. * @param count + * the number of elements to retrieve. * @param map - * @return the ResultSet + * the map defining the correspondence between SQL type names + * and Java types. + * @return the {@code ResultSet} the array's custom type values. if a + * database error has occurred. * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException; /** - * Returns a ResultSet object which holds the entries of the SQL ARRAY - * associated with this Array. + * Returns a {@code ResultSet} object which holds the entries of the SQL + * {@code ARRAY} associated with this array. * * @param map - * @return the ResultSet + * the map defining the correspondence between SQL type names + * and Java types. + * @return the array as a {@code ResultSet}. * @throws SQLException + * if there is a database error. + * @since Android 1.0 */ public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException; diff --git a/sql/src/main/java/java/sql/BatchUpdateException.java b/sql/src/main/java/java/sql/BatchUpdateException.java index f39dc5e..36a7ef9 100644 --- a/sql/src/main/java/java/sql/BatchUpdateException.java +++ b/sql/src/main/java/java/sql/BatchUpdateException.java @@ -20,23 +20,26 @@ package java.sql; import java.io.Serializable; /** - * An exception thrown if a problem occurs during a batch update operation. + * This exception is 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 + * A {@code BatchUpdateException} provides additional information about the + * problem that occurred, compared with a standard {@code SQLException}. It + * supplies update counts for successful commands which were executed before the * exception was encountered. - * <p> + * </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. + * Once a batch update command fails and a {@code 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} 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 {@code Statement.EXECUTE_FAILED}. + * </p> + * + * @since Android 1.0 */ public class BatchUpdateException extends SQLException implements Serializable { @@ -45,19 +48,26 @@ public class BatchUpdateException extends SQLException implements Serializable { private int[] updateCounts = null; /** - * Creates a BatchUpdateException with the Reason, SQLState, and Update - * Counts set to null and a Vendor Code of 0. + * Creates a default {@code BatchUpdateException} with the parameters + * <i>reason</i>, <i>SQLState</i>, and <i>update counts</i> set to {@code + * null} and the <i>vendor code</i> set to 0. + * + * @since Android 1.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. + * Creates a {@code BatchUpdateException} with the {@code updateCounts} set + * to the supplied value. All other fields are set to their + * default values. * * @param updateCounts - * the array of Update Counts to use in initialization + * the array of {@code updateCounts} giving the number of + * successful updates (or another status code) for each command + * in the batch that was attempted. + * @since Android 1.0 */ public BatchUpdateException(int[] updateCounts) { super(); @@ -65,14 +75,18 @@ public class BatchUpdateException extends SQLException implements Serializable { } /** - * 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. + * Creates a {@code BatchUpdateException} with the {@code updateCounts} and + * {@code reason} set to the supplied values. All other fields are set to their + * default values. * * @param reason - * the initialization value for Reason + * the message providing information about the source of this + * exception. * @param updateCounts - * the array of Update Counts to set + * the array of {@code updateCounts} giving the number of + * successful updates (or another status code) for each command + * in the batch that was attempted. + * @since Android 1.0 */ public BatchUpdateException(String reason, int[] updateCounts) { super(reason); @@ -80,16 +94,20 @@ public class BatchUpdateException extends SQLException implements Serializable { } /** - * 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. + * Creates a {@code BatchUpdateException} with the {@code reason}, {@code + * SQLState} and {@code updateCounts} set to the supplied values. All other + * fields are set to their default values. * * @param reason - * the value to use for the Reason + * the message providing information about the source of this + * exception. * @param SQLState - * the X/OPEN value to use for the SQLState + * the X/OPEN value to use for the {@code SQLState} * @param updateCounts - * the array of Update Counts to set + * the array of {@code updateCounts} giving the number of + * successful updates (or another status code) for each command + * in the batch that was attempted. + * @since Android 1.0 */ public BatchUpdateException(String reason, String SQLState, int[] updateCounts) { @@ -98,18 +116,21 @@ public class BatchUpdateException extends SQLException implements Serializable { } /** - * 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. + * Creates a {@code BatchUpdateException} for the case where all relevant + * information is provided. * * @param reason - * the value to use for the Reason + * the message providing information about the source of this + * exception. * @param SQLState - * the X/OPEN value to use for the SQLState + * the X/OPEN value to use for the {@code SQLState}. * @param vendorCode - * the value to use for the vendor error code + * the value to use for the vendor error code. * @param updateCounts - * the array of Update Counts to set + * the array of {@code updateCounts} giving the number of + * successful updates (or another status code) for each command + * in the batch that was attempted. + * @since Android 1.0 */ public BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts) { @@ -118,28 +139,30 @@ public class BatchUpdateException extends SQLException implements Serializable { } /** - * Gets the Update Counts array. + * Gets the <i>update count</i> array giving status information for every + * command that was attempted in the batch. * <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. + * If a batch update command fails and a {@code BatchUpdateException} is + * thrown, the JDBC driver may continue processing the remaining commands in + * the batch. If the driver does so, the array returned by {@code + * 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 + * {@code 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: + * exception was thrown. Alternatively, if the driver continues to + * process commands following an error, for each successive command + * there is a corresponding element in the array giving one of the + * following status values: * <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. + * <li>the number of successful updates</li> <li>{@code + * Statement.SUCCESS_NO_INFO} indicating that the command completed + * successfully, but the amount of altered rows is unknown.</li> + * <li>{@code Statement.EXECUTE_FAILED} indicating that the command + * was unsuccessful.</li> * </ol> + * @since Android 1.0 */ public int[] getUpdateCounts() { return updateCounts; diff --git a/sql/src/main/java/java/sql/Blob.java b/sql/src/main/java/java/sql/Blob.java index 2b3cff5..e6d9b19 100644 --- a/sql/src/main/java/java/sql/Blob.java +++ b/sql/src/main/java/java/sql/Blob.java @@ -21,140 +21,162 @@ import java.io.OutputStream; import java.io.InputStream; /** - * A Java interface mapping for the SQL BLOB type. + * A Java interface representing the SQL {@code 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. + * An SQL {@code BLOB} type stores a large array of binary data (bytes) as the + * value in a column of a database. + * </p> + * The {@code java.sql.Blob} interface provides methods for setting and + * retrieving data in the {@code Blob}, for querying {@code Blob} data length, + * and for searching for data within the {@code Blob}. + * + * @since Android 1.0 */ public interface Blob { /** - * Retrieves this Blob object as a binary stream. + * Retrieves this {@code Blob} object as a binary stream. * - * @return a binary InputStream giving access to the Blob data + * @return a binary {@code InputStream} giving access to the {@code Blob} + * data. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ public InputStream getBinaryStream() throws SQLException; /** - * Gets a portion of the value of this Blob as an array of bytes. + * Gets a portion of the value of this {@code 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 + * the position of the first byte in the {@code Blob} to get, + * where the first byte in the {@code 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 + * the number of bytes to get. + * @return a byte array containing the data from the {@code Blob}, starting + * at {@code pos} and is up to {@code length} bytes long. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ public byte[] getBytes(long pos, int length) throws SQLException; /** - * Gets the number of bytes in this Blob object. + * Gets the number of bytes in this {@code Blob} object. * - * @return an long value with the length of the Blob in bytes + * @return a {@code long} value with the length of the {@code Blob} in + * bytes. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ 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. + * Search for the position in this {@code Blob} at which a specified pattern + * begins, starting at a specified position within the {@code Blob}. * * @param pattern - * a Blob containing the pattern of data to search for in this - * Blob + * a {@code Blob} containing the pattern of data to search for in + * this {@code 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. + * the position within this {@code Blob} to start the search, + * where the first position in the {@code Blob} is {@code 1}. + * @return a {@code long} value with the position at which the pattern + * begins. Returns {@code -1} if the pattern is not found in this + * {@code Blob}. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ 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. + * Search for the position in this {@code Blob} at which the specified + * pattern begins, starting at a specified position within the {@code Blob}. * * @param pattern * a byte array containing the pattern of data to search for in - * this Blob + * this {@code 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. + * the position within this {@code Blob} to start the search, + * where the first position in the {@code Blob} is {@code 1}. + * @return a {@code long} value with the position at which the pattern + * begins. Returns {@code -1} if the pattern is not found in this + * {@code Blob}. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ public long position(byte[] pattern, long start) throws SQLException; /** - * Gets a stream that can be used to write binary data to this Blob. + * Gets a stream that can be used to write binary data to this {@code 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. + * the position within this {@code Blob} at which to start + * writing, where the first position in the {@code Blob} is + * {@code 1}. + * @return a binary {@code InputStream} which can be used to write data into + * the {@code Blob} starting at the specified position. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ 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. + * Writes a specified array of bytes to this {@code 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 + * the position within this {@code Blob} at which to start + * writing, where the first position in the {@code Blob} is + * {@code 1}. * @param theBytes - * an array of bytes to write into the Blob - * @return an integer containing the number of bytes written to the Blob + * an array of bytes to write into the {@code Blob}. + * @return an integer containing the number of bytes written to the {@code + * Blob}. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ 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. + * Writes a portion of a specified byte array to this {@code 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 + * the position within this {@code Blob} at which to start + * writing, where the first position in the {@code Blob} is + * {@code 1}. * @param theBytes - * an array of bytes to write into the Blob + * an array of bytes to write into the {@code Blob}. * @param offset * the offset into the byte array from which to start writing - * data - the first byte in the array has offset 0. + * data - the first byte in the array has offset {@code 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 + * the length of data to write in number of bytes. + * @return an integer containing the number of bytes written to the {@code + * Blob}. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ 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. + * Truncate the value of this {@code Blob} object to a specified length in + * bytes. * * @param len - * the length of data in bytes to truncate the value of this Blob + * the length of data in bytes after which this {@code Blob} + * is to be truncated. * @throws SQLException - * if an error occurs accessing the Blob + * if an error occurs accessing the {@code Blob}. + * @since Android 1.0 */ public void truncate(long len) throws SQLException; } diff --git a/sql/src/main/java/java/sql/CallableStatement.java b/sql/src/main/java/java/sql/CallableStatement.java index 2097277..7a90041 100644 --- a/sql/src/main/java/java/sql/CallableStatement.java +++ b/sql/src/main/java/java/sql/CallableStatement.java @@ -25,1099 +25,1254 @@ import java.io.InputStream; import java.io.Reader; /** - * An interface used to call Stored Procedures. + * An interface used to call <i>Stored Procedures</i>. * <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 <.procedurename>.[([parameter1,parameter2,...])]} - * - * {call <.procedurename>.[([parameter1,parameter2,...])]} - * </code> + * The JDBC API provides an SQL escape syntax allowing <i>Stored Procedures</i> + * 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 {@code OUT} parameter. Other parameters can be declared as + * {@code IN}, {@code OUT}, or {@code INOUT}. Parameters are referenced either by + * name or by a numerical index starting at 1. * <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. + * The correct syntax is: + * </p> + * <dd> + * <dl> + * { ?= call <procedurename> [( [parameter1,parameter2,...] )] } + * </dl> + * <dl> + * { call <procedurename> [( [parameter1,parameter2,...] )] } + * </dl> + * </code></dd> </p> {@code IN} parameters are set before calling the procedure, + * using the setter methods which are inherited from {@code PreparedStatement}. + * For {@code OUT} parameters, their type must be registered before executing + * the stored procedure. The values are retrieved using the getter methods + * defined in the {@code 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. + * {@code CallableStatement}s can return one or more {@code ResultSets}. In the + * event that multiple {@code ResultSets} are returned, they are accessed using + * the methods inherited from the {@code Statement} interface. + * </p> + * + * @since Android 1.0 */ public interface CallableStatement extends PreparedStatement { /** - * Gets the value of a specified JDBC <code>ARRAY</code> parameter as a - * java.sql.Array. + * Gets the value of a specified JDBC {@code ARRAY} parameter as a + * {@code java.sql.Array}. * * @param parameterIndex - * the parameter number index, where the first parameter has - * index 1 - * @return a java.sql.Array containing the parameter value + * the parameter index, where the first parameter has + * index 1. + * @return a {@code java.sql.Array} containing the parameter value. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public Array getArray(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array. + * Gets the value of a specified JDBC {@code ARRAY} parameter as a {@code + * java.sql.Array}. * * @param parameterName - * the parameter of interest's name - * @return a <code>java.sql.Array</code> containing the parameter value + * the desired parameter's name. + * @return a {@code java.sql.Array} containing the parameter's value. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Array getArray(String parameterName) throws SQLException; /** - * Returns a new {@link BigDecimal} representation of the JDBC - * <code>NUMERIC</code> parameter specified by the input index. + * Returns a new {@link BigDecimal} representation of the JDBC {@code + * NUMERIC} parameter specified by the input index. * * @param parameterIndex - * the parameter number index (starts from 1) - * @return a <code>java.math.BigDecimal</code> with the value of the - * specified parameter. The value <code>null</code> is returned if - * the parameter in question is an SQL <code>NULL</code> + * the parameter number index where the first parameter has index + * 1. + * @return a {@code java.math.BigDecimal} representing the value of the + * specified parameter. The value {@code null} is returned if + * the parameter in question is an SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public BigDecimal getBigDecimal(int parameterIndex) throws SQLException; /** - * Returns a new {@link BigDecimal} representation of the JDBC - * <code>NUMERIC</code> parameter specified by the input index. The number - * of digits after the decimal point is specified by <code>scale</code>. + * Returns a new {@link BigDecimal} representation of the JDBC {@code + * NUMERIC} parameter specified by the input index. The number of digits + * after the decimal point is specified by {@code scale}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param scale - * the number of digits after the decimal point to get - * @return a <code>java.math.BigDecimal</code> with the value of the - * specified parameter. The value <code>null</code> is returned if - * the parameter in question is an SQL <code>NULL</code> + * the number of digits after the decimal point to get. + * @return a {@code java.math.BigDecimal} representing the value of the + * specified parameter. The value {@code null} is returned if + * the parameter in question is an SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database - * @deprecated Use {@link #getBigDecimal(int)} or {@link #getBigDecimal(String)} + * if a database error occurs. + * @deprecated Use {@link #getBigDecimal(int)} or + * {@link #getBigDecimal(String)} + * @since Android 1.0 */ @Deprecated public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException; /** - * Returns a new {@link BigDecimal} representation of the JDBC - * <code>NUMERIC</code> parameter specified by the input name. + * Returns a new {@link BigDecimal} representation of the JDBC {@code + * NUMERIC} parameter specified by the input name. * * @param parameterName - * the name of the parameter - * @return a java.math.BigDecimal with the value of the specified parameter. - * null if the value is SQL NULL. + * the desired parameter's name. + * @return a {@code java.math.BigDecimal} representing the value of the + * specified parameter. The value {@code null} is returned if + * the parameter in question is an SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public BigDecimal getBigDecimal(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob + * Gets the value of a specified JDBC {@code BLOB} parameter as a {@code + * 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. + * index 1. + * @return a {@code java.sql.Blob} representing the value of the + * specified parameter. The value {@code null} is returned if + * the parameter in question is an SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public Blob getBlob(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob + * Gets the value of a specified JDBC {@code BLOB} parameter as a {@code + * java.sql.Blob}. * * @param parameterName - * the name of the parameter - * @return a java.sql.Blob with the value. null if the value is SQL NULL. + * the desired parameter's name. + * @return a {@code java.sql.Blob} representing the value of the + * specified parameter. The value {@code null} is returned if + * the parameter in question is an SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public Blob getBlob(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC BIT parameter as a boolean + * Gets the value of a specified JDBC {@code 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 + * index 1. + * @return a {@code boolean} representing the parameter value. {@code false} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public boolean getBoolean(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC <code>BIT</code> parameter as a - * boolean + * Gets the value of a specified JDBC {@code BIT} parameter as a {@code + * boolean}. * * @param parameterName - * the parameter of interest's name - * @return a <code>boolean</code> representation of the value of the - * parameter. <code>false</code> is returned if the SQL value is - * <code>NULL</code>. + * the desired parameter's name. + * @return a {@code boolean} representation of the value of the parameter. + * {@code false} is returned if the SQL value is {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public boolean getBoolean(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC TINYINT parameter as a byte + * Gets the value of a specified JDBC {@code TINYINT} parameter as a {@code + * 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. + * index 1. + * @return a {@code byte} representation of the value of the parameter. + * {@code 0} is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public byte getByte(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC <code>TINYINT</code> parameter as a - * Java <code>byte</code>. + * Gets the value of a specified JDBC {@code TINYINT} parameter as a Java + * {@code byte}. * * @param parameterName - * the parameter of interest's name - * @return a <code>byte</code> representation of the value of the - * parameter. <code>0</code> is returned if the SQL value is - * <code>NULL</code>. + * the desired parameter's name. + * @return a {@code byte} representation of the value of the parameter. + * {@code 0} is returned if the SQL value is {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public byte getByte(String parameterName) throws SQLException; /** - * Returns a byte array representation of the indexed JDBC - * <code>BINARY</code> or <code>VARBINARY</code> parameter. + * Returns a byte array representation of the indexed JDBC {@code BINARY} or + * {@code VARBINARY} 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. + * index 1. + * @return an array of bytes giving the value of the parameter. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public byte[] getBytes(int parameterIndex) throws SQLException; /** - * Returns a byte array representation of the named JDBC <code>BINARY</code> - * or <code>VARBINARY</code> parameter. + * Returns a byte array representation of the named JDBC {@code BINARY} or + * {@code VARBINARY} parameter. * * @param parameterName - * the name of the parameter - * @return an array of bytes with the value of the parameter. null if the - * value is SQL NULL. + * the name of the parameter. + * @return an array of bytes giving the value of the parameter. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public byte[] getBytes(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob + * Gets the value of a specified JDBC {@code CLOB} parameter as a {@code + * 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. + * index 1. + * @return a {@code java.sql.Clob} representing the value of the + * parameter. {@code null} is returned if the value is SQL + * {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Clob + * @since Android 1.0 */ public Clob getClob(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob + * Gets the value of a specified JDBC {@code CLOB} parameter as a {@code + * java.sql.Clob}. * * @param parameterName - * the name of the parameter - * @return a java.sql.Clob with the value of the parameter. null if the - * value is SQL NULL. + * the name of the parameter. + * @return a {@code java.sql.Clob} with the value of the parameter. {@code + * null} is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Clob + * @since Android 1.0 */ public Clob getClob(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC DATE parameter as a java.sql.Date. + * Gets the value of the specified JDBC {@code DATE} parameter as a {@code + * 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. + * index 1. + * @return the {@code java.sql.Date} representing the parameter's value. + * {@code null} is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Date + * @since Android 1.0 */ 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. + * Gets the value of the specified JDBC {@code DATE} parameter as a {@code + * java.sql.Date}, using the specified {@code 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 + * The JDBC driver uses the calendar to create the Date using a particular + * timezone and locale. The default behavior of the driver is to use the Java * virtual machine default settings. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * 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. + * the {@code Calendar} to use to construct the date + * @return the {@code java.sql.Date} giving the parameter's value. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Date + * @since Android 1.0 */ public Date getDate(int parameterIndex, Calendar cal) throws SQLException; /** - * Gets the value of a specified JDBC DATE parameter as a java.sql.Date. + * Gets the value of the specified JDBC {@code DATE} parameter as a {@code + * java.sql.Date}. * * @param parameterName - * the name of the parameter - * @return the java.sql.Date with the parameter value. null if the value is - * SQL NULL. + * the name of the desired parameter. + * @return the {@code java.sql.Date} giving the parameter's value. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Date + * @since Android 1.0 */ public Date getDate(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC DATE parameter as a java.sql.Date., - * using a specified Calendar to construct the date. + * Gets the value of the specified JDBC {@code DATE} parameter as a {@code + * java.sql.Date}, using the specified {@code 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 + * The JDBC driver uses the calendar to create the date using a particular + * timezone and locale. The default behavior of the driver is to use the Java * virtual machine default settings. + * </p> * * @param parameterName - * the parameter name + * the name of the desired parameter. * @param cal - * used for creating the returned <code>Date</code> - * @return the java.sql.Date with the parameter value. null if the value is - * SQL NULL. + * used for creating the returned {@code Date}. + * @return the {@code java.sql.Date} giving the parameter's value. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Date + * @since Android 1.0 */ public Date getDate(String parameterName, Calendar cal) throws SQLException; /** - * Gets the value of a specified JDBC DOUBLE parameter as a double + * Gets the value of the specified JDBC {@code DOUBLE} parameter as a + * {@code 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. + * index 1. + * @return the parameter's value as a {@code double}. {@code 0.0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public double getDouble(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC DOUBLE parameter as a double + * Gets the value of the specified JDBC {@code DOUBLE} parameter as a + * {@code double}. * * @param parameterName - * the parameter name - * @return the parameter value as represented in a Java <code>double</code>. - * An SQL value of <code>NULL</code> gets represented as - * <code>0</code> (zero). + * the name of the desired parameter. + * @return the parameter's value as a {@code double}. {@code 0.0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public double getDouble(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC FLOAT parameter as a float + * Gets the value of the specified JDBC {@code FLOAT} parameter as a {@code + * 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. + * index 1. + * @return the parameter's value as a {@code float}. {@code 0.0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public float getFloat(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC <code>FLOAT</code> parameter as a - * Java <code>float</code>. + * Gets the value of the specified JDBC {@code FLOAT} parameter as a Java + * {@code float}. * * @param parameterName - * the parameter name - * @return the parameter value as represented in a Java <code>float</code>. - * An SQL value of <code>NULL</code> gets represented as - * <code>0</code> (zero). + * the name of the desired parameter. + * @return the parameter's value as a {@code float}. {@code 0.0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public float getFloat(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC INTEGER parameter as an int + * Gets the value of the specified JDBC {@code INTEGER} parameter as an + * {@code 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. + * index 1. + * @return the {@code int} giving the parameter's value. {@code 0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public int getInt(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC INTEGER parameter as an int + * Gets the value of the specified JDBC {@code INTEGER} parameter as an + * {@code int}. * * @param parameterName - * the name of the parameter - * @return the int with the parameter value. 0 if the value is SQL NULL. + * the name of the desired parameter. + * @return the {@code int} giving the parameter's value. {@code 0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public int getInt(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC BIGINT parameter as a long + * Gets the value of the specified JDBC {@code BIGINT} parameter as a + * {@code 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. + * index 1. + * @return the {@code long} giving the parameter's value. {@code 0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public long getLong(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC BIGINT parameter as a long + * Gets the value of the specified JDBC {@code BIGINT} parameter as a + * {@code long}. * * @param parameterName - * the name of the parameter - * @return the long with the parameter value. 0 if the value is SQL NULL. + * the name of the desired parameter. + * @return the {@code long} giving the parameter's value. {@code 0} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public long getLong(String parameterName) throws SQLException; /** - * Gets the value of a specified parameter as a Java <code>Object</code>. + * Gets the value of the specified parameter as a Java {@code Object}. * <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. + * with a {@code registerOutParameter} call. If a parameter was registered + * as a {@code java.sql.Types.OTHER} then it may hold abstract types that + * are particular to the connected database. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @return an Object holding the value of the parameter. * @throws SQLException - * if there is a problem accessing the database + * if a database error occurs. + * @since Android 1.0 */ public Object getObject(int parameterIndex) throws SQLException; /** - * Gets the value of a specified parameter as an Object. A Map is supplied - * to provide custom mapping of the parameter value. + * Gets the value of the specified parameter as an {@code Object}. The + * {@code Map} gives the correspondence between SQL types and Java classes. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param map - * the Map holing the mapping from SQL types to Java classes + * the {@code Map} giving the correspondence between SQL + * types and Java classes. * @return an Object holding the value of the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException; /** - * Gets the value of a specified parameter as an Object. + * Gets the value of the specified parameter as an {@code Object}. * <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. + * The object type returned is the JDBC type that was registered for + * the parameter by an earlier call to {@link #registerOutParameter}. + * If a parameter was registered as a {@code java.sql.Types.OTHER} + * then it may hold abstract types that are particular to the + * connected database. + * </p> * * @param parameterName - * the parameter name - * @return the Java <code>Object</code> representation of the value of the + * the parameter name. + * @return the Java {@code Object} representation of the value of the * parameter. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Object getObject(String parameterName) throws SQLException; /** - * Gets the value of a specified parameter as an Object. A Map is supplied - * to provide custom mapping of the parameter value. + * Gets the value of a specified parameter as an {@code Object}. The + * actual return type is determined by the {@code Map} parameter which + * gives the correspondence between SQL types and Java classes. * * @param parameterName - * the parameter name + * the parameter name. * @param map - * the <code>Map</code> of SQL types to their Java counterparts - * @return an <code>Object</code> holding the value of the parameter. + * the {@code Map} of SQL types to their Java counterparts + * @return an {@code Object} holding the value of the parameter. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Object getObject(String parameterName, Map<String, Class<?>> map) throws SQLException; /** - * Gets the value of a specified JDBC REF(<structured type>) parameter as a - * java.sql.Ref + * Gets the value of a specified SQL {@code REF(<structured type>)} + * parameter as a {@code java.sql.Ref}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 - * @return a java.sql.Ref with the parameter value. null if the value is SQL - * NULL. + * index 1. + * @return a {@code java.sql.Ref} with the parameter value. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public Ref getRef(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC REF(<structured type>) parameter as a - * java.sql.Ref + * Gets the value of a specified SQL {@code REF(<structured type>)} + * parameter as a {@code java.sql.Ref}. * * @param parameterName - * the parameter name - * @return the target parameter's value in the form of a - * <code>java.sql.Ref</code>. A <code>null</code> reference is - * returned for a parameter value of SQL <code>NULL</code>. + * the desired parameter's name. + * @return the parameter's value in the form of a {@code + * java.sql.Ref}. A {@code null} reference is returned if the + * parameter's value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @see Ref + * @since Android 1.0 */ public Ref getRef(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC SMALLINT parameter as a short + * Gets the value of a specified JDBC {@code SMALLINT} parameter as a + * {@code 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. + * index 1. + * @return the parameter's value as a {@code short}. 0 is returned + * if the parameter's value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public short getShort(int parameterIndex) throws SQLException; /** - * Gets the value of a specified JDBC <code>SMALLINT</code> parameter as a - * short + * Gets the value of a specified JDBC {@code SMALLINT} parameter as a + * {@code short}. * * @param parameterName - * the parameter name - * @return the value of the target parameter as a Java <code>short</code>. - * If the value is an SQL <code>NULL</code> then <code>0</code> - * (zero) is returned. + * the desired parameter's name. + * @return the parameter's value as a {@code short}. 0 is returned + * if the parameter's value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public short getShort(String parameterName) 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>. + * Returns the indexed parameter's value as a {@code String}. The + * parameter value must be one of the JDBC types {@code CHAR}, + * {@code VARCHAR} or {@code LONGVARCHAR}. * <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. + * The {@code String} corresponding to a {@code CHAR} of fixed length + * will be of identical length to the value in the database inclusive + * of padding characters. + * </p> * * @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. + * index 1. + * @return the parameter's value as a {@code String}. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public String getString(int parameterIndex) throws SQLException; /** * Returns the named 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>. + * be one of the JDBC types {@code CHAR}, {@code VARCHAR} or {@code + * LONGVARCHAR}. * <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 + * The string corresponding to a {@code CHAR} of fixed length will be of + * identical length to the value in the database inclusive of padding * characters. + * </p> * * @param parameterName - * the parameter name - * @return a String with the parameter value. null if the value is SQL NULL. + * the desired parameter's name. + * @return the parameter's value as a {@code String}. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public String getString(String parameterName) throws SQLException; /** - * Gets the value of a specified JDBC TIME parameter as a java.sql.Time. + * Gets the value of a specified JDBC {@code TIME} parameter as a {@code + * 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. + * index 1. + * @return the parameter's value as a {@code java.sql.Time}. + * {@code null} is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @since Android 1.0 */ 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. + * Gets the value of a specified JDBC {@code TIME} parameter as a {@code + * java.sql.Time}, using the supplied {@code Calendar} to construct the + * time. The JDBC driver uses the calendar to handle specific timezones + * and locales in order to determine {@code Time}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * 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. + * the calendar to use in constructing {@code Time}. + * @return the parameter's value as a {@code java.sql.Time}. + * {@code null} is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @see java.util.Calendar + * @since Android 1.0 */ public Time getTime(int parameterIndex, Calendar cal) throws SQLException; /** - * Gets the value of a specified JDBC <code>TIME</code> parameter as a - * <code>java.sql.Time</code> + * Gets the value of a specified JDBC {@code TIME} parameter as a {@code + * java.sql.Time}. * * @param parameterName - * the parameter name - * @return a new <code>java.sql.Time</code> with the parameter value. A - * <code>null</code> reference is returned for an SQL value of - * <code>NULL</code> + * the name of the desired parameter. + * @return a new {@code java.sql.Time} with the parameter's value. A {@code + * null} reference is returned for an SQL value of {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @since Android 1.0 */ public Time getTime(String parameterName) 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. + * Gets the value of a specified JDBC {@code TIME} parameter as a {@code + * java.sql.Time}, using the supplied {@code Calendar} to construct + * the time. The JDBC driver uses the calendar to handle specific + * timezones and locales when creating {@code Time}. * * @param parameterName - * the parameter name + * the name of the desired parameter. * @param cal - * used for creating the returned <code>Time</code> - * @return a <code>java.sql.Time</code> with the parameter value. A - * <code>null</code> reference is returned for an SQL value of - * <code>NULL</code> + * used for creating the returned {@code Time} + * @return a new {@code java.sql.Time} with the parameter's value. A {@code + * null} reference is returned for an SQL value of {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @see java.util.Calendar + * @since Android 1.0 */ public Time getTime(String parameterName, Calendar cal) throws SQLException; /** - * Returns the indexed parameter's <code>TIMESTAMP</code> value as a - * <code>java.sql.Timestamp</code>. + * Returns the indexed parameter's {@code TIMESTAMP} value as a {@code + * java.sql.Timestamp}. * * @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> + * @return the parameter's value as a {@code java.sql.Timestamp}. A + * {@code null} reference is returned for an SQL value of {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ 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. + * Returns the indexed parameter's {@code TIMESTAMP} value as a {@code + * java.sql.Timestamp}. The JDBC driver uses the supplied {@code Calendar} + * 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> + * used for creating the returned {@code Timestamp} + * @return the parameter's value as a {@code java.sql.Timestamp}. A + * {@code null} reference is returned for an SQL value of {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException; /** - * Returns the named parameter's <code>TIMESTAMP</code> value as a - * <code>java.sql.Timestamp</code>. + * Returns the named parameter's {@code TIMESTAMP} value as a {@code + * java.sql.Timestamp}. * * @param parameterName - * the parameter name - * @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> + * the name of the desired parameter. + * @return the parameter's value as a {@code java.sql.Timestamp}. A + * {@code null} reference is returned for an SQL value of {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ public Timestamp getTimestamp(String parameterName) 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. + * Returns the indexed parameter's {@code TIMESTAMP} value as a {@code + * java.sql.Timestamp}. The JDBC driver uses the supplied {@code Calendar} + * to handle specific timezones and locales when creating the result. * * @param parameterName - * the parameter name + * the name of the desired parameter. * @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> + * used for creating the returned {@code Timestamp} + * @return the parameter's value as a {@code java.sql.Timestamp}. A + * {@code null} reference is returned for an SQL value of {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException; /** - * Gets the value of a specified JDBC DATALINK parameter as a java.net.URL. + * Gets the value of a specified JDBC {@code DATALINK} parameter as a + * {@code 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. + * index 1. + * @return a {@code URL} giving the parameter's value. {@code null} + * is returned if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see java.net.URL + * @since Android 1.0 */ public URL getURL(int parameterIndex) throws SQLException; /** - * Returns the named parameter's JDBC <code>DATALINK</code> value in a new - * Java <code>java.net.URL</code>. + * Returns the named parameter's JDBC {@code DATALINK} value in a new Java + * {@code java.net.URL}. * * @param parameterName - * the parameter name - * @return a new <code>java.net.URL</code> encapsulating the parameter - * value. A <code>null</code> reference is returned for an SQL - * value of <code>NULL</code> + * the name of the desired parameter. + * @return a new {@code java.net.URL} encapsulating the parameter value. A + * {@code null} reference is returned for an SQL value of {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see java.net.URL + * @since Android 1.0 */ public URL getURL(String parameterName) throws SQLException; /** - * Defines the Type of a specified OUT parameter. All OUT parameters must - * have their Type defined before a stored procedure is executed. + * Defines the type of a specified {@code OUT} parameter. All {@code 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. + * The type supplied in the {@code sqlType} parameter fixes the + * type that will be returned by the getter methods of + * {@code CallableStatement}. + * If a database specific type is expected for a parameter, the Type {@code + * java.sql.Types.OTHER} should be used. Note that there is another variant + * of this method for User Defined Types or a {@code REF} type. + * </p> * * @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. + * the JDBC type as defined by {@code java.sql.Types}. The JDBC + * types {@code NUMERIC} and {@code DECIMAL} should be defined + * using {@link #registerOutParameter(int, int, int)}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Types + * @since Android 1.0 */ 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. + * Defines the Type of a specified {@code OUT} parameter. All {@code OUT} + * parameters must have their type defined before a stored procedure is + * executed. This version of the {@code registerOutParameter} method, which + * has a scale parameter, should be used for the JDBC types {@code NUMERIC} + * and {@code 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. + * The type supplied in the {@code sqlType} parameter fixes the + * type that will be returned by the getter methods of + * {@code CallableStatement}. + * </p> * * @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 type as defined by {@code 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 + * if a database error occurs. + * @see Types + * @since Android 1.0 */ 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. + * Defines the Type of a specified {@code OUT} parameter. This variant + * of the method is designed for use with parameters that are + * <i>User Defined Types</i> (UDT) or a {@code REF} type, although it + * can be used for any type. * * @param paramIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param sqlType - * a JDBC type expressed as a constant from {@link Types} + * 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. + * an SQL type name. For a {@code REF} type, this name should be + * the fully qualified name of the referenced type. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Ref + * @since Android 1.0 */ public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException; /** - * Defines the Type of a specified OUT parameter. All OUT parameters must - * have their Type defined before a stored procedure is executed. + * Defines the Type of a specified {@code 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. + * The type supplied in the {@code sqlType} parameter fixes the + * type that will be returned by the getter methods of + * {@code CallableStatement}. + * If a database-specific type is expected for a parameter, the Type {@code + * java.sql.Types.OTHER} should be used. Note that there is another variant + * of this method for User Defined Types or a {@code REF} type. + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param sqlType * a JDBC type expressed as a constant from {@link Types}. Types - * NUMERIC and DECIMAL should be defined using the variant of - * this method that takes a <code>scale</code> parameter. + * {@code NUMERIC} and {@code DECIMAL} should be defined using + * the variant of this method that takes a {@code scale} + * parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void registerOutParameter(String parameterName, 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. + * Defines the Type of a specified {@code OUT} parameter. All {@code OUT} + * parameters must have their Type defined before a stored procedure is + * executed. This version of the {@code registerOutParameter} method, which + * has a scale parameter, should be used for the JDBC types {@code NUMERIC} + * and {@code 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. + * The type supplied in the {@code sqlType} parameter fixes the + * type that will be returned by the getter methods of + * {@code CallableStatement}. + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param sqlType - * a JDBC type expressed as a constant from {@link Types} + * a JDBC type expressed as a constant from {@link 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 + * if a database error occurs. + * @since Android 1.0 */ public void registerOutParameter(String parameterName, 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.Registers the designated - * output parameter. + * Defines the Type of a specified {@code OUT} parameter. This variant of + * the method is designed for use with parameters that are <i>User Defined + * Types</i> (UDT) or a {@code REF} type, although it can be used for any + * type. * * @param parameterName * the parameter name * @param sqlType * a JDBC type expressed as a constant from {@link Types} * @param typeName - * the fully qualified name of an SQL structured type. For a REF - * type, this name should be the fully qualified name of the - * referenced type. + * the fully qualified name of an SQL structured type. For a + * {@code REF} type, this name should be the fully qualified name + * of the referenced type. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException; /** * Sets the value of a specified parameter to the content of a supplied - * InputStream, which has a specified number of bytes. + * {@code InputStream}, which has a specified number of bytes. * <p> - * This is a good method for setting an SQL LONVARCHAR parameter where the - * length of the data is large. Data is read from the InputStream until - * end-of-file is reached or the specified number of bytes is copied. + * This is a good method for setting an SQL {@code LONVARCHAR} parameter + * where the length of the data is large. Data is read from the {@code + * InputStream} until end-of-file is reached or the specified number of + * bytes is copied. + * </p> * * @param parameterName * the parameter name * @param theInputStream - * the ASCII InputStream carrying the data to update the - * parameter with + * the ASCII input stream carrying the data to update the + * parameter with. * @param length - * the number of bytes in the InputStream to copy to the - * parameter + * the number of bytes in the {@code InputStream} to copy to the + * parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setAsciiStream(String parameterName, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of a specified parameter to a supplied - * java.math.BigDecimal value. + * Sets the value of a specified parameter to a supplied {@code + * java.math.BigDecimal} value. * * @param parameterName - * the name of the parameter + * the name of the parameter. * @param theBigDecimal - * the java.math.BigInteger value to set + * the {@code java.math.BigInteger} value to set. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setBigDecimal(String parameterName, BigDecimal theBigDecimal) throws SQLException; /** * Sets the value of a specified parameter to the content of a supplied - * binary InputStream, which has a specified number of bytes. + * binary {@code InputStream}, which has a specified number of bytes. * <p> * Use this method when a large amount of data needs to be set into a - * LONGVARBINARY parameter. + * {@code LONGVARBINARY} parameter. + * </p> * * @param parameterName - * the name of the parameter + * the name of the parameter. * @param theInputStream - * the binary InputStream carrying the data to update the - * parameter + * the binary {@code InputStream} carrying the data to update the + * parameter. * @param length - * the number of bytes in the InputStream to copy to the - * parameter + * the number of bytes in the {@code InputStream} to copy to the + * parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setBinaryStream(String parameterName, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of a specified parameter to a supplied boolean value. + * Sets the value of a specified parameter to a supplied {@code boolean} + * value. * * @param parameterName - * the parameter name + * the parameter name. * @param theBoolean - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setBoolean(String parameterName, boolean theBoolean) throws SQLException; /** - * Sets the value of a specified parameter to a supplied byte value. + * Sets the value of a specified parameter to a supplied {@code byte} value. * * @param parameterName - * the parameter name + * the parameter name. * @param theByte - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setByte(String parameterName, byte theByte) throws SQLException; /** * Sets the value of a specified parameter to a supplied array of bytes. The - * array is mapped to <code>VARBINARY</code> or else - * <code>LONGVARBINARY</code> in the connected database. + * array is mapped to {@code VARBINARY} or else {@code LONGVARBINARY} in the + * connected database. * * @param parameterName - * the parameter name + * the parameter name. * @param theBytes - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setBytes(String parameterName, byte[] theBytes) throws SQLException; /** * Sets the value of a specified parameter to the character content of a - * Reader object, with the specified length of character data. + * {@code Reader} object, with the specified length of character data. * * @param parameterName - * the parameter name + * the parameter name. * @param reader - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param length - * a count of the characters contained in <code>reader</code> + * a count of the characters contained in {@code reader}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Date - * value. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Date} value. * * @param parameterName - * the parameter name + * the parameter name. * @param theDate - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setDate(String parameterName, Date theDate) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Date - * value, using a supplied Calendar to map the Date. The Calendar allows the - * application to control the timezone used to compute the SQL DATE in the - * database - without the supplied Calendar, the driver uses the default - * timezone of the Java virtual machine. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Date} value, using a supplied calendar to map the date. The + * calendar allows the application to control the timezone used to compute + * the SQL {@code DATE} in the database. In case that no calendar is + * supplied, the driver uses the default timezone of the Java virtual + * machine. * * @param parameterName - * the parameter name + * the parameter name. * @param theDate - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param cal - * a Calendar to use to construct the SQL DATE value + * a {@code Calendar} to use to construct the SQL {@code DATE} + * value. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see java.util.Calendar + * @see Date + * @since Android 1.0 */ public void setDate(String parameterName, Date theDate, Calendar cal) throws SQLException; /** - * Sets the value of a specified parameter to a supplied double value. + * Sets the value of a specified parameter to a supplied {@code double} + * value. * * @param parameterName - * the parameter name + * the parameter name. * @param theDouble - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setDouble(String parameterName, double theDouble) throws SQLException; /** - * Sets the value of a specified parameter to to a supplied float value. + * Sets the value of a specified parameter to to a supplied {@code float} + * value. * * @param parameterName - * the parameter name + * the parameter name. * @param theFloat - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setFloat(String parameterName, float theFloat) throws SQLException; /** - * Sets the value of a specified parameter to a supplied int value. + * Sets the value of a specified parameter to a supplied {@code int} value. * * @param parameterName - * the parameter name + * the parameter name. * @param theInt - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setInt(String parameterName, int theInt) throws SQLException; /** - * Sets the value of a specified parameter to a supplied long value. + * Sets the value of a specified parameter to a supplied {@code long} value. * * @param parameterName - * the parameter name + * the parameter name. * @param theLong - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setLong(String parameterName, long theLong) throws SQLException; /** - * Sets the value of a specified parameter to SQL NULL. Don't use this - * version of setNull for User Defined Types or for REF type parameters. + * Sets the value of a specified parameter to SQL {@code NULL}. Don't use + * this version of {@code setNull} for <i>User Defined Types</i> (UDT) or + * for {@code REF} type parameters. * * @param parameterName - * the parameter name + * the parameter name. * @param sqlType - * a JDBC type expressed as a constant from {@link Types} + * a JDBC type expressed as a constant from {@link Types}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setNull(String parameterName, int sqlType) throws SQLException; /** - * Sets the value of a specified parameter to be SQL NULL where the - * parameter type is either <code>REF</code> or user defined (e.g. - * <code>STRUCT</code>, <code>JAVA_OBJECT</code> etc). + * Sets the value of a specified parameter to be SQL {@code NULL} where the + * parameter type is either {@code REF} or user defined (e.g. {@code STRUCT} + * , {@code JAVA_OBJECT} etc). * <p> * For reasons of portability, the caller is expected to supply both the SQL - * Type code and Type name (which is just the parameter name if the type is - * user defined, or the name of the type being referenced if a REF). + * type code and type name (which is just the parameter name if the type is + * user defined, referred to as a {@code UDT}, or the name of the referenced + * type in case of a {@code REF} type). + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param sqlType - * a JDBC type expressed as a constant from {@link Types} + * a JDBC type expressed as a constant from {@link Types}. * @param typeName * if the target parameter is a user defined type then this - * should contain the full type name - * - * the fully qualified name of a UDT or REF type - ignored if the parameter - * is not a UDT. + * should contain the full type name. The fully qualified name of + * a {@code UDT} or {@code REF} type is ignored if the parameter + * is not a {@code UDT}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Types + * @since Android 1.0 */ public void setNull(String parameterName, int sqlType, String typeName) throws SQLException; /** * Sets the value of a specified parameter using a supplied object. Prior to - * issuing this request to the connected database <code>theObject</code> - * is transformed to the corresponding SQL type according to the normal Java + * issuing this request to the connected database {@code theObject} is + * transformed to the corresponding SQL type according to the standard Java * to SQL mapping rules. * <p> - * If the object's class implements the interface SQLData, the JDBC driver - * calls <code>SQLData.writeSQL</code> to write it to the SQL data stream. - * If <code>theObject</code> implements any of the following interfaces - * then it is the role of the driver to flow the value to the connected - * database using the appropriate SQL type : - * <ul> - * <li>{@link Ref} - * <li>{@link Struct} - * <li>{@link Array} - * <li>{@link Clob} - * <li>{@link Blob} - * </ul> + * If the object's class implements the interface {@code SQLData}, the JDBC + * driver calls {@code SQLData.writeSQL} to write it to the SQL data stream. + * If {@code theObject} implements any of the following interfaces then the + * driver is in charge of mapping the value to the appropriate SQL type. + * <ul><li>{@link Ref}</li> + * <li>{@link Struct}</li> + * <li>{@link Array}</li> + * <li>{@link Clob}</li> + * <li>{@link Blob}</li> </ul> + * </p> * * @param parameterName * the parameter name * @param theObject * the new value with which to update the parameter * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see SQLData + * @since Android 1.0 */ public void setObject(String parameterName, Object theObject) throws SQLException; @@ -1125,29 +1280,33 @@ public interface CallableStatement extends PreparedStatement { /** * Sets the value of a specified parameter using a supplied object. * <p> - * The Object is converted to the given targetSqlType before it is sent to - * the database. If the object has a custom mapping (its class implements - * the interface SQLData), the JDBC driver will call the method - * SQLData.writeSQL to write it to the SQL data stream. If - * <code>theObject</code> implements any of the following interfaces then - * it is the role of the driver to flow the value to the connected database - * using the appropriate SQL type : + * The parameter {@code theObject} is converted to the given {@code + * targetSqlType} before it is sent to the database. If the object has a + * custom mapping (its class implements the interface {@code SQLData}), the + * JDBC driver calls the method {@code SQLData.writeSQL} to write it to the + * SQL data stream. If {@code theObject} is an instance of one of the + * following types * <ul> - * <li>{@link Ref} - * <li>{@link Struct} - * <li>{@link Array} - * <li>{@link Clob} - * <li>{@link Blob} + * <li>{@link Ref}</li> + * <li>{@link Struct}</li> + * <li>{@link Array}</li> + * <li>{@link Clob}</li> + * <li>{@link Blob}</li> * </ul> + * then the driver is in charge of mapping the value to the appropriate + * SQL type and deliver it to the database. + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param theObject - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param targetSqlType - * a JDBC type expressed as a constant from {@link Types} + * a JDBC type expressed as a constant from {@link Types}. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see SQLData + * @since Android 1.0 */ public void setObject(String parameterName, Object theObject, int targetSqlType) throws SQLException; @@ -1155,148 +1314,170 @@ public interface CallableStatement extends PreparedStatement { /** * Sets the value of a specified parameter using a supplied object. * <p> - * The Object is converted to the given targetSqlType before it is sent to - * the database. If the object has a custom mapping (its class implements - * the interface SQLData), the JDBC driver will call the method - * SQLData.writeSQL to write it to the SQL data stream. If - * <code>theObject</code> implements any of the following interfaces then - * it is the role of the driver to flow the value to the connected database - * using the appropriate SQL type : + * The object is converted to the given {@code targetSqlType} before it is + * sent to the database. If the object has a custom mapping (its class + * implements the interface {@code SQLData}), the JDBC driver calls the + * method {@code SQLData.writeSQL} to write it to the SQL data stream. If + * {@code theObject} implements any of the following interfaces * <ul> - * <li>{@link Ref} - * <li>{@link Struct} - * <li>{@link Array} - * <li>{@link Clob} - * <li>{@link Blob} + * <li>{@link Ref}</li> + * <li>{@link Struct}</li> + * <li>{@link Array}</li> + * <li>{@link Clob}</li> + * <li>{@link Blob}</li> * </ul> + * then the driver is charge of mapping the value to the appropriate + * SQL type. + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param theObject - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param targetSqlType - * a JDBC type expressed as a constant from {@link Types} + * a JDBC type expressed as a constant from {@link Types}. * @param scale - * where applicable, the number of digits after the decimal + * where applicable, the number of digits after the decimal. * point. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see SQLData + * @since Android 1.0 */ public void setObject(String parameterName, Object theObject, int targetSqlType, int scale) throws SQLException; /** - * Sets the value of a specified parameter to a supplied short value. + * Sets the value of a specified parameter to a supplied {@code short} + * value. * * @param parameterName - * the name of the parameter + * the name of the parameter. * @param theShort - * a short value to update the parameter + * a short value to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setShort(String parameterName, short theShort) throws SQLException; /** - * Sets the value of a specified parameter to a supplied String. + * Sets the value of a specified parameter to a supplied {@code String}. * * @param parameterName - * the name of the parameter + * the name of the parameter. * @param theString - * a String value to update the parameter + * a {@code String} value to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public void setString(String parameterName, String theString) throws SQLException; /** - * Sets the value of the parameter named <code>parameterName</code> to the - * value of the supplied <code>java.sql.Time</code>. + * Sets the value of the parameter named {@code parameterName} to the value + * of the supplied {@code java.sql.Time}. * * @param parameterName - * the parameter name + * the parameter name. * @param theTime - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @since Android 1.0 */ public void setTime(String parameterName, Time theTime) throws SQLException; /** - * Sets the value of the parameter named <code>parameterName</code> to the - * value of the supplied <code>java.sql.Time</code> using the supplied - * Calendar. + * Sets the value of the parameter named {@code parameterName} to the value + * of the supplied {@code java.sql.Time} using the supplied calendar. * <p> - * The driver uses the supplied Calendar to create the SQL TIME value, which - * allows it to use a custom timezone - otherwise the driver uses the - * default timezone of the Java virtual machine. + * The driver uses the supplied {@code Calendar} to create the SQL + * {@code TIME} value, which allows it to use a custom timezone - + * otherwise the driver uses the default timezone of the Java + * virtual machine. * * @param parameterName - * the parameter name + * the parameter name. * @param theTime - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param cal - * used for creating the new SQL <code>TIME</code> value + * used for creating the new SQL {@code TIME} value. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Time + * @since Android 1.0 */ public void setTime(String parameterName, Time theTime, Calendar cal) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Timestamp - * value. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Timestamp} value. * * @param parameterName - * the parameter name + * the parameter name. * @param theTimestamp - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ public void setTimestamp(String parameterName, Timestamp theTimestamp) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Timestamp - * value, using the supplied Calendar. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Timestamp} value, using the supplied calendar. * <p> - * The driver uses the supplied Calendar to create the SQL TIMESTAMP value, - * which allows it to use a custom timezone - otherwise the driver uses the - * default timezone of the Java virtual machine. + * The driver uses the supplied calendar to create the SQL {@code TIMESTAMP} + * value, which allows it to use a custom timezone - otherwise the driver + * uses the default timezone of the Java virtual machine. + * </p> * * @param parameterName - * the parameter name + * the parameter name. * @param theTimestamp - * the new value with which to update the parameter + * the new value with which to update the parameter. * @param cal - * used for creating the new SQL <code>TIME</code> value + * used for creating the new SQL {@code TIME} value. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see Timestamp + * @see java.util.Calendar + * @since Android 1.0 */ public void setTimestamp(String parameterName, Timestamp theTimestamp, Calendar cal) throws SQLException; /** - * Sets the value of a specified parameter to the supplied java.net.URL. + * Sets the value of a specified parameter to the supplied {@code + * java.net.URL}. * * @param parameterName - * the parameter name + * the parameter name. * @param theURL - * the new value with which to update the parameter + * the new value with which to update the parameter. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @see java.net.URL + * @since Android 1.0 */ public void setURL(String parameterName, URL theURL) throws SQLException; /** - * Gets whether the value of the last OUT parameter read was SQL NULL. + * Gets whether the value of the last {@code OUT} parameter read was SQL + * {@code NULL}. * - * @return true if the last parameter was SQL NULL, false otherwise. + * @return true if the last parameter was SQL {@code NULL}, {@code false} + * otherwise. * @throws SQLException - * if a database error happens + * if a database error occurs. + * @since Android 1.0 */ public boolean wasNull() throws SQLException; } diff --git a/sql/src/main/java/java/sql/Clob.java b/sql/src/main/java/java/sql/Clob.java index e97b3b1..339d4e5 100644 --- a/sql/src/main/java/java/sql/Clob.java +++ b/sql/src/main/java/java/sql/Clob.java @@ -25,150 +25,168 @@ 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. + * An SQL {@code 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. + * The {@code java.sql.Clob} interface provides methods for setting and + * retrieving data in the {@code Clob}, for querying {@code Clob} data length, + * for searching for data within the {@code Clob}. + * + * @since Android 1.0 */ public interface Clob { /** - * Gets the value of this Clob object as an ASCII stream. + * Gets the value of this {@code Clob} object as an ASCII stream. * - * @return an ASCII InputStream giving access to the Clob data + * @return an ASCII {@code InputStream} giving access to the + * {@code Clob} data. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public InputStream getAsciiStream() throws SQLException; /** - * Gets the value of this Clob object as a java.io.Reader. + * Gets the data of this {@code Clob} object in a {@code java.io.Reader}. * - * @return a character stream Reader object giving access to the Clob data + * @return a character stream Reader object giving access to the {@code + * Clob} data. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public Reader getCharacterStream() throws SQLException; /** - * Gets a copy of a specified substring in this Clob. + * Gets a copy of a specified substring in this {@code Clob}. * * @param pos - * the index of the start of the substring in the Clob + * the index of the start of the substring in the {@code Clob}. * @param length - * the length of the data to retrieve - * @return A String containing the requested data + * the length of the data to retrieve. + * @return A string containing the requested data. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public String getSubString(long pos, int length) throws SQLException; /** - * Retrieves the number of characters in this Clob object. + * Retrieves the number of characters in this {@code Clob} object. * - * @return a long value with the number of character in this Clob. + * @return a long value with the number of character in this {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public long length() throws SQLException; /** - * Retrieves the character position at which a specified Clob object appears - * in this Clob object. + * Retrieves the character position at which a specified {@code Clob} object + * appears in this {@code Clob} object. * * @param searchstr - * the specified Clob to search for + * the specified {@code 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. + * the position within this {@code Clob} to start the search + * @return a long value with the position at which the specified {@code + * Clob} occurs within this {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public long position(Clob searchstr, long start) throws SQLException; /** * Retrieves the character position at which a specified substring appears - * in this Clob object. + * in this {@code Clob} object. * * @param searchstr - * th String to search for + * the 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. + * the position at which to start the search within this {@code + * Clob}. + * @return a long value with the position at which the specified string + * occurs within this {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ 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. + * {@code Clob} object, starting at specified position. * * @param pos - * the position at which to start the writing + * the position at which to start the writing. * @return an OutputStream which can be used to write ASCII characters to - * this Clob. + * this {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ 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. + * Retrieves a stream which can be used to write a stream of unicode + * characters to this {@code 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. + * the position at which to start the writing. + * @return a Writer which can be used to write unicode characters to this + * {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public Writer setCharacterStream(long pos) throws SQLException; /** - * Writes a given Java String to this Clob object at a specified position. + * Writes a given Java String to this {@code Clob} object at a specified + * position. * * @param pos - * the position at which to start the writing + * the position at which to start the writing. * @param str - * the String to write - * @return the number of characters written + * the string to write. + * @return the number of characters written. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public int setString(long pos, String str) throws SQLException; /** - * Writes len characters of String, starting at a specified character - * offset, to this Clob. + * Writes {@code len} characters of a string, starting at a specified + * character offset, to this {@code Clob}. * * @param pos - * the position at which to start the writing + * the position at which to start the writing. * @param str - * the String to write + * the String to write. * @param offset - * the offset within str to start writing from + * the offset within {@code str} to start writing from. * @param len - * the number of characters to write - * @return the number of characters written + * the number of characters to write. + * @return the number of characters written. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public int setString(long pos, String str, int offset, int len) throws SQLException; /** - * Truncates this Clob to have a specified length of characters. + * Truncates this {@code Clob} after the specified number of characters. * * @param len - * the length in characters to truncate this Clob + * the length in characters giving the place to + * truncate this {@code Clob}. * @throws SQLException - * if an error occurs accessing the Clob + * if an error occurs accessing the {@code Clob}. + * @since Android 1.0 */ public void truncate(long len) throws SQLException; } diff --git a/sql/src/main/java/java/sql/Connection.java b/sql/src/main/java/java/sql/Connection.java index 4683299..523071c 100644 --- a/sql/src/main/java/java/sql/Connection.java +++ b/sql/src/main/java/java/sql/Connection.java @@ -20,83 +20,110 @@ package java.sql; import java.util.Map; /** - * A Connection represents a link from a Java application to a database. All SQL + * 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. - * + * Database statements that are executed within this context form a + * database session which forms one or more closed transactions. Especially In distributed applications, multiple concurrent connections may exist accessing the same values of the database. + * which may lead to the following phenomena (referred to as <i>transaction isolation levels</i>): + * <ul> + * <li><i>dirty reads</i>:<br> + * reading values from table rows that are not committed.</br></li> + * <li><i>non-repeatable reads</i>:<br> + * reading table rows more than once in a transaction but getting back different + * data because other transactions have altered the rows between the reads.</br></li> + * <li><i>phantom reads</i>:<br> + * retrieving additional "phantom" rows in the course of repeated table reads + * because other transactions have inserted additional rows that satisfy an + * SQL {@code WHERE} clause</br></li> + * </ul> + * + * @since Android 1.0 */ public interface Connection { /** * A constant indicating that transactions are not supported. + * + * @since Android 1.0 */ 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. + * No <i>dirty reads</i> are permitted, therefore transactions may not read + * a row containing uncommitted values - but does not prevent an application + * from <i>non-repeatable reads</i> and <i>phantom reads</i>. + * + * @since Android 1.0 */ 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>. + * In the case that reading uncommitted values is allowed, the following + * incidents may happen which may lead to an invalid results: + * <ul> + * <li><i>dirty reads</i></li> + * <li><i>non-repeatable reads</i></li> + * <li><i>phantom reads</i></li> + * </ul> + * + * @since Android 1.0 */ public static final int TRANSACTION_READ_UNCOMMITTED = 1; /** - * A constant indicating that dirty reads and non-repeatable reads are - * prevented; phantom reads can occur. + * A constant indicating that <i>dirty reads</i> and <i>non-repeatable + * reads</i> are <b>prevented</b> but <i>phantom reads</i> can occur. + * + * @since Android 1.0 */ 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>. + * The constant that indicates that the following incidents are <b>all + * prevented</b> (the opposite of {@link #TRANSACTION_READ_UNCOMMITTED}): + * <ul> + * <li><i>dirty reads</i></li> + * <li><i>non-repeatable reads</i></li> + * <li><i>phantom reads</i></li> + * </ul> + * + * @since Android 1.0 */ 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. + * Discards all warnings that may have arisen for this connection. + * Subsequent calls to {@link #getWarnings()} will return {@code null} + * up until a new warning condition occurs. * * @throws SQLException - * if there is a problem accessing the database + * 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. + * method 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. + * It is strongly recommended that all connections are closed before they + * are dereferenced by the application ready for garbage collection. + * Although the {@code finalize} method of the connection closes the + * connection before garbage collection takes place, it is not advisable to + * leave the {@code close} operation to take place in this way. Mainly + * because undesired side-effects may appear. + * </p> * * @throws SQLException - * if there is a problem accessing the database + * 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. + * Commits all of the changes made since the last {@code commit} or + * {@code rollback} of the associated transaction. All locks in the database + * held by this connection are also relinquished. Calling this operation on + * connection objects in {@code auto-commit} mode leads to an error. * * @throws SQLException * if there is a problem accessing the database or if the target @@ -105,41 +132,41 @@ public interface Connection { public void commit() throws SQLException; /** - * Returns a new instance of <code>Statement</code> for issuing SQL - * commands to the remote database. + * Returns a new instance of {@code Statement} 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>. + * {@code ResultSets} generated by the returned statement will default to + * type {@code ResultSet.TYPE_FORWARD_ONLY} and concurrency level {@code + * ResultSet.CONCUR_READ_ONLY}. * - * @return a <code>Statement</code> object with default settings. + * @return a {@code Statement} object with default settings. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @see ResultSet */ 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. + * Returns a new instance of {@code Statement} whose associated {@code + * ResultSet}s have the characteristics specified in the type and + * concurrency arguments. * * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} </li> <li> + * {@link ResultSet#TYPE_SCROLL_INSENSITIVE} </li> <li> + * {@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_UPDATABLE} - * <li>{@link ResultSet#CONCUR_READ_ONLY} + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> <li> + * {@link ResultSet#CONCUR_READ_ONLY}</li> * </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. + * @return a new instance of {@code Statement} capable of manufacturing + * {@code ResultSet}s that satisfy the specified {@code + * resultSetType} and {@code resultSetConcurrency} values. * @throws SQLException * if there is a problem accessing the database */ @@ -147,158 +174,165 @@ public interface Connection { throws SQLException; /** - * Returns a new instance of <code>Statement</code> whose associated - * <code>ResultSet</code>s will have the characteristics specified in the + * Returns a new instance of {@code Statement} whose associated + * {@code ResultSet}s will have the characteristics specified in the * type, concurrency and holdability arguments. * * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</li> + * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_UPDATABLE} - * <li>{@link ResultSet#CONCUR_READ_ONLY} + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> + * <li>{@link ResultSet#CONCUR_READ_ONLY}</li> * </ul> * @param resultSetHoldability - * one of : + * one of the following holdability mode specifiers: * <ul> - * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT} - * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT} + * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}</li> + * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</li> * </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. + * @return a new instance of {@code Statement} capable of + * manufacturing {@code ResultSet}s that satisfy the + * specified {@code resultSetType}, + * {@code resultSetConcurrency} and + * {@code resultSetHoldability} values. * @throws SQLException - * if there is a problem accessing the database + * 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. + * Returns a {@code boolean} indicating whether or not this connection is in + * the {@code auto-commit} operating mode. * - * @return <code>true</code> if auto-commit is on, otherwise - * <code>false</code> + * @return {@code true} if {@code auto-commit} is on, otherwise {@code + * false}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public boolean getAutoCommit() throws SQLException; /** - * Gets this Connection object's current catalog name. + * Gets this {@code Connection} object's current catalog name. * - * @return the catalog name. <code>null</code> if there is no catalog + * @return the catalog name. {@code null} if there is no catalog * name. * @throws SQLException - * if there is a problem accessing the database + * 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. + * Returns the holdability property that any {@code ResultSet} produced by + * this instance will have. * - * @return one of : + * @return one of the following holdability mode specifiers: * <ul> - * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT} - * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT} + * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}</li> <li> + * {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</li> * </ul> * @throws SQLException - * if there is a problem accessing the a database + * if there is a problem accessing the a database. + * @since Android 1.0 */ 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. + * returned {@code DatabaseMetaData} describes the database topography, + * available stored procedures, SQL syntax and so on. * - * @return a <code>DatabaseMetaData</code> object containing the database - * description + * @return a {@code DatabaseMetaData} object containing the database + * description. * @throws SQLException - * if there is a problem accessing the a database + * if there is a problem accessing the a database. + * @since Android 1.0 */ public DatabaseMetaData getMetaData() throws SQLException; /** - * Returns the present value of transaction isolation for this Connection - * instance. + * Returns the transaction isolation level for this connection. * - * @return the transaction isolation value + * @return the transaction isolation value. * @throws SQLException - * if there is a problem accessing the database + * 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 + * @since Android 1.0 */ public int getTransactionIsolation() throws SQLException; /** - * Returns the Type Map associated with this Connection object. The type map - * will be empty unless the application has added at least one entry. + * Returns the type mapping associated with this {@code Connection} object. + * The type mapping must be set on the application level. * - * @return the Type Map as a <code>java.util.Map</code> + * @return the Type Map as a {@code java.util.Map}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Map<String, Class<?>> getTypeMap() 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. + * Gets the first instance of any {@code SQLWarning} 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} 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. + * returned {@code SQLWarning} object it is possible to obtain all of + * this connection's warning objects. + * </p> * - * @return the first warning as an SQLWarning object (may be - * <code>null</code>) + * @return the first warning as an SQLWarning object (may be {@code null}). * @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. + * @since Android 1.0 */ 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. + * Returns a {@code boolean} indicating whether or not this connection is in + * the {@code closed} state. The {@code 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> + * @return {@code true} if closed, otherwise {@code false}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public boolean isClosed() throws SQLException; /** - * Returns a boolean indication of whether or not this connection is - * currently in read-only state. + * Returns a {@code boolean} indicating whether or not this connection is + * currently in the {@code read-only} state. * - * @return <code>true</code> if in read-only state, otherwise - * <code>false</code>. + * @return {@code true} if in read-only state, otherwise {@code false}. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ 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 + * {@code sql} expressed in the underlying system's native SQL * syntax. * * @param sql @@ -310,354 +344,364 @@ public interface Connection { 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. + * Returns a new instance of {@code CallableStatement} 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 + * @return a new instance of {@code CallableStatement} representing the SQL + * statement. {@code ResultSet}s emitted from this {@code + * CallableStatement} 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 + * if a problem occurs accessing the database. + * @since Android 1.0 */ 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. + * Returns a new instance of {@code CallableStatement} that may be used for + * making stored procedure calls to the database. {@code ResultSet}s emitted + * from this {@code CallableStatement} will satisfy the specified {@code + * resultSetType} and {@code resultSetConcurrency} values. * * @param sql * the SQL statement * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</li> + * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_READ_ONLY} - * <li>{@link ResultSet#CONCUR_UPDATABLE} + * <li>{@link ResultSet#CONCUR_READ_ONLY}</li> + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> * </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. + * @return a new instance of {@code CallableStatement} representing the + * precompiled SQL statement. {@code ResultSet}s emitted from this + * {@code CallableStatement} will satisfy the specified {@code + * resultSetType} and {@code resultSetConcurrency} values. * @throws SQLException * if a problem occurs accessing the database + * @since Android 1.0 */ 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. + * Returns a new instance of {@code CallableStatement} that may be used for + * making stored procedure calls to the database. {@code ResultSet}s created + * from this {@code CallableStatement} will have characteristics determined + * by the specified type, concurrency and holdability arguments. * * @param sql * the SQL statement * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</li> + * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_READ_ONLY} - * <li>{@link ResultSet#CONCUR_UPDATABLE} + * <li>{@link ResultSet#CONCUR_READ_ONLY}</li> + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> * </ul> * @param resultSetHoldability - * one of : + * one of the following holdability mode specifiers: * <ul> - * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT} - * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT} + * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}</li> + * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</li> * </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. + * @return a new instance of {@code CallableStatement} representing the + * precompiled SQL statement. {@code ResultSet}s emitted from this + * {@code CallableStatement} will satisfy the specified {@code + * resultSetType}, {@code resultSetConcurrency} and {@code + * resultSetHoldability} values. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ 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. + * Returns a new instance of {@code PreparedStatement} 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 + * precompiled version of the statement to the database. If + * the driver does not support precompiled statements, the statement will + * not reach the database server until it is executed. This distinction + * determines the moment when {@code SQLException}s get raised. + * </p> + * By default, {@code ResultSet}s 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 + * @return the {@code PreparedStatement} containing the supplied SQL + * statement. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ 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. + * Creates a default {@code PreparedStatement} that can retrieve + * automatically generated keys. Parameter {@code autoGeneratedKeys} may be + * used to tell the driver whether such keys should be made accessible. + * This is only relevant when the {@code sql} statement is an {@code insert} + * statement. * <p> + * An SQL statement which may have {@code IN} parameters can be stored and + * precompiled in a {@code PreparedStatement}. The {@code PreparedStatement} + * can then be 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. + * precompiled version of the statement to the database. If + * the driver does not support precompiled statements, the statement will + * not reach the database server until it is executed. This distinction + * determines the moment when {@code SQLException}s get raised. * <p> - * By default, ResultSets from the returned object will be + * By default, {@code ResultSet}s from the returned object will be * {@link ResultSet#TYPE_FORWARD_ONLY} type with a * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency. + * </p> * * @param sql * the SQL statement. * @param autoGeneratedKeys - * one of : + * one of the following generated key options: * <ul> - * <li>{@link Statement#RETURN_GENERATED_KEYS} - * <li>{@link Statement#NO_GENERATED_KEYS} + * <li>{@link Statement#RETURN_GENERATED_KEYS}</li> + * <li>{@link Statement#NO_GENERATED_KEYS}</li> * </ul> - * @return a new <code>PreparedStatement</code> instance representing the - * input SQL statement. + * @return a new {@code PreparedStatement} instance representing the input + * SQL statement. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ 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. + * Creates a default {@code PreparedStatement} that can retrieve the + * auto-generated keys designated by a supplied array. If {@code sql} is an + * SQL {@code INSERT} statement, the parameter {@code columnIndexes} 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} 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. + * precompiled version of the statement to the database. If + * the driver does not support precompiled statements, the statement will + * not reach the database server until it is executed. This distinction + * determines the moment when {@code SQLException}s get raised. + * </p> * <p> - * By default, ResultSets from the returned object will be + * By default, {@code ResultSet}s from the returned object will be * {@link ResultSet#TYPE_FORWARD_ONLY} type with a - * {@link ResultSet#CONCUR_READ_ONLY} mode of concurrency. + * {@link ResultSet#CONCUR_READ_ONLY} concurrency mode. + * </p> * * @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 + * @return the PreparedStatement containing the supplied SQL statement. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ 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>. + * Creates a {@code PreparedStatement} that generates {@code ResultSet}s + * with the specified values of {@code resultSetType} and {@code + * resultSetConcurrency}. * * @param sql - * the SQL statement. It can contain one or more '?' IN parameter - * placeholders + * the SQL statement. It can contain one or more {@code '?'} + * {@code IN} parameter placeholders. * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</li> + * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_READ_ONLY} - * <li>{@link ResultSet#CONCUR_UPDATABLE} + * <li>{@link ResultSet#CONCUR_READ_ONLY}</li> + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> * </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. + * @return a new instance of {@code PreparedStatement} containing the SQL + * statement {@code sql}. {@code ResultSet}s emitted from this + * {@code PreparedStatement} will satisfy the specified {@code + * resultSetType} and {@code resultSetConcurrency} values. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException; /** - * Creates a PreparedStatement that generates ResultSets with the specified - * type, concurrency and holdability + * Creates a {@code PreparedStatement} that generates {@code ResultSet}s + * with the specified type, concurrency and holdability * * @param sql - * the SQL statement. It can contain one or more '?' IN parameter - * placeholders + * the SQL statement. It can contain one or more {@code '?' IN} + * parameter placeholders. * @param resultSetType - * one of : + * one of the following type specifiers: * <ul> - * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE} - * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE} - * <li>{@link ResultSet#TYPE_FORWARD_ONLY} + * <li>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</li> + * <li>{@link ResultSet#TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@link ResultSet#TYPE_FORWARD_ONLY}</li> * </ul> * @param resultSetConcurrency - * one of : + * one of the following concurrency mode specifiers: * <ul> - * <li>{@link ResultSet#CONCUR_READ_ONLY} - * <li>{@link ResultSet#CONCUR_UPDATABLE} + * <li>{@link ResultSet#CONCUR_READ_ONLY}</li> + * <li>{@link ResultSet#CONCUR_UPDATABLE}</li> * </ul> * @param resultSetHoldability - * one of : + * one of the following holdability mode specifiers: * <ul> - * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT} - * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT} + * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}</li> + * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</li> * </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. + * @return a new instance of {@code PreparedStatement} containing the SQL + * statement {@code sql}. {@code ResultSet}s emitted from this + * {@code PreparedStatement} will satisfy the specified {@code + * resultSetType}, {@code resultSetConcurrency} and {@code + * resultSetHoldability} values. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ 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. + * Creates a default {@code PreparedStatement} that can retrieve the + * auto-generated keys designated by a supplied array. If {@code sql} is an + * SQL {@code INSERT} statement, {@code columnNames} 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} 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 + * the driver is not capable of handling 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> + * will have a bearing on precisely <i>when</i> {@code SQLException} * instances get raised. + * </p> * <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. + * {@link ResultSet#CONCUR_READ_ONLY} concurrency mode. + * </p> * * @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 + * @return the PreparedStatement containing the supplied SQL statement. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ 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. + * Releases the specified {@code savepoint} from the present transaction. Once removed, + * the {@code Savepoint} is considered invalid and should not be referenced + * further. * * @param savepoint - * the object targeted for removal + * 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 + * {@code savepoint} is considered not valid in this * transaction. + * @since Android 1.0 */ 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 + * Rolls back all updates made so far in this transaction and + * relinquishes 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. + * @since Android 1.0 */ 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. + * Undoes all changes made after the supplied {@code 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 + * if there is a problem accessing the database. + * @since Android 1.0 */ public void rollback(Savepoint savepoint) throws SQLException; /** - * Sets this connection's auto-commit mode on or off. + * Sets this connection's auto-commit mode {@code on} or {@code 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 are run and committed as separate transactions. + * By contrast, setting auto-commit to {@code 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> + * </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. + * Statements are not considered successfully completed until all associated + * {@code ResultSet}s and output parameters have been obtained or closed. + * </p> * <p> * Calling this operation during an uncommitted transaction will result in * it being committed. + * </p> * * @param autoCommit - * boolean indication of whether to put the target connection - * into auto-commit mode (<code>true</code>) or not (<code>false</code>) - * + * {@code boolean} indication of whether to put the target + * connection into auto-commit mode ({@code true}) or not ( + * {@code false}). * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public void setAutoCommit(boolean autoCommit) throws SQLException; @@ -669,18 +713,19 @@ public interface Connection { * @param catalog * the catalog name to use. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public void setCatalog(String catalog) throws SQLException; /** - * Sets the holdability of ResultSets created by this Connection. + * Sets the holdability of the {@code ResultSet}s created by this Connection. * * @param holdability - * one of : + * one of the following holdability mode specifiers: * <ul> - * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT} - * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT} + * <li>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</li> + * <li>{@link ResultSet#HOLD_CURSORS_OVER_COMMIT}</li> * <li> * </ul> * @throws SQLException @@ -693,32 +738,36 @@ public interface Connection { * <p> * This serves as a hint to the driver, which can enable database * optimizations. + * </p> * * @param readOnly - * true to set the Connection to read only mode. false disables - * read-only mode + * {@code true} to set the Connection to read only mode. {@code + * false} disables read-only mode. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public void setReadOnly(boolean readOnly) throws SQLException; /** - * Creates an unnamed Savepoint in the current transaction. + * Creates an unnamed {@code Savepoint} in the current transaction. * - * @return a Savepoint object for this savepoint. + * @return a {@code Savepoint} object for this savepoint. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Savepoint setSavepoint() throws SQLException; /** - * Creates a named Savepoint in the current transaction. + * Creates a named {@code Savepoint} in the current transaction. * * @param name - * the name to use for the new Savepoint. - * @return a Savepoint object for this savepoint. + * the name to use for the new {@code Savepoint}. + * @return a {@code Savepoint} object for this savepoint. * @throws SQLException - * if there is a problem accessing the database + * if there is a problem accessing the database. + * @since Android 1.0 */ public Savepoint setSavepoint(String name) throws SQLException; @@ -727,10 +776,11 @@ public interface Connection { * <p> * If this method is called during a transaction, the results are * implementation defined. + * </p> * * @param level * the new transaction isolation level to use from the following - * list of possible values : + * list of possible values: * <ul> * <li>{@link #TRANSACTION_READ_COMMITTED} * <li>{@link #TRANSACTION_READ_UNCOMMITTED} @@ -739,21 +789,21 @@ public interface Connection { * </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. + * {@code level} is not one of the expected constant values. + * @since Android 1.0 */ public void setTransactionIsolation(int level) throws SQLException; /** - * Sets the <code>TypeMap</code> for this connection. The input - * <code>map</code> should contain mappings between complex Java and SQL - * types. + * Sets the {@code TypeMap} for this connection. The input {@code map} + * should contain mappings between complex Java and SQL types. * * @param map - * the new type map + * the new type map. * @throws SQLException - * if there is a problem accessing the database or if - * <code>map</code> is not an instance of {@link Map}. + * if there is a problem accessing the database or if {@code + * map} is not an instance of {@link Map}. + * @since Android 1.0 */ public void setTypeMap(Map<String, Class<?>> map) throws SQLException; } diff --git a/sql/src/main/java/java/sql/DataTruncation.java b/sql/src/main/java/java/sql/DataTruncation.java index 7150ec7..a472cc5 100644 --- a/sql/src/main/java/java/sql/DataTruncation.java +++ b/sql/src/main/java/java/sql/DataTruncation.java @@ -21,9 +21,11 @@ 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>. + * value either when reading (resulting in warning), or when writing data + * (resulting in an error). The {@code SQLState} error code for truncated data + * is {@code 01004}. + * + * @since Android 1.0 */ public class DataTruncation extends SQLWarning implements Serializable { @@ -46,23 +48,25 @@ public class DataTruncation extends SQLWarning implements Serializable { 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. + * Creates the {@code DataTruncation} object. The reason is set to {@code + * "Data truncation"}, the {@code ErrorCode} is set to the {@code + * SQLException} default value, and the other fields are set to the values + * supplied as arguments. * * @param index * the Index value of the column value or parameter that was - * truncated + * truncated. * @param parameter - * true if it was a Parameter value that was truncated, false - * otherwise + * {@code true} if it was a parameter value that was truncated, + * {@code false} otherwise. * @param read - * true if the truncation occurred on a read operation, false - * otherwise + * {@code true} if the truncation occurred on a read operation, + * {@code false} otherwise. * @param dataSize - * the original size of the truncated data + * the original size of the truncated data. * @param transferSize - * the size of the data after truncation + * the size of the data after truncation. + * @since Android 1.0 */ public DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize) { @@ -78,7 +82,8 @@ public class DataTruncation extends SQLWarning implements Serializable { * 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. + * value is set to {@code -1} if the size is unknown. + * @since Android 1.0 */ public int getDataSize() { return dataSize; @@ -88,6 +93,7 @@ public class DataTruncation extends SQLWarning implements Serializable { * Gets the index of the column or of the parameter that was truncated. * * @return the index number of the column or of the parameter. + * @since Android 1.0 */ public int getIndex() { return index; @@ -96,8 +102,9 @@ public class DataTruncation extends SQLWarning implements Serializable { /** * 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 + * @return {@code true} if the value truncated was a parameter value, + * {@code false} if it was a column value. + * @since Android 1.0 */ public boolean getParameter() { return parameter; @@ -107,18 +114,20 @@ public class DataTruncation extends SQLWarning implements Serializable { * 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. + * @return {@code true} if the value was truncated on a read operation, + * {@code false} otherwise. + * @since Android 1.0 */ public boolean getRead() { return read; } /** - * Gets the number of bytes of data that was actually read or written + * 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. + * to {@code -1} if the size is unknown. + * @since Android 1.0 */ public int getTransferSize() { return transferSize; diff --git a/sql/src/main/java/java/sql/DatabaseMetaData.java b/sql/src/main/java/java/sql/DatabaseMetaData.java index 8c0f17c..82219c5 100644 --- a/sql/src/main/java/java/sql/DatabaseMetaData.java +++ b/sql/src/main/java/java/sql/DatabaseMetaData.java @@ -18,261 +18,359 @@ package java.sql; /** - * An interface which provides comprehensive information about the database. + * An interface which provides comprehensive information about the database + * management system and its supported features. * <p> - * This interface is implemented by JDBC driver writers in order to provide - * information about the underlying Database capabilities and the JDBC driver - * capabilities taken together. + * This interface is implemented by JDBC driver vendors in order to provide + * information about the underlying database capabilities in association with + * the JDBC driver. + * </p> * <p> - * Some of the methods in this interface take String parameters which are - * Patterns. Within these string Patterns, '%' and '_' characters have special - * meanings. '%' means "match any substring of 0 or more characters". '_' means - * "match any one character". Only metadata entries that match the pattern are - * returned. If such a search pattern string is set to <code>null</code>, - * that argument's criteria are dropped from the search. - * + * Some of the methods in this interface take string parameters which are + * patterns. Within these string patterns, {@code '%'} and {@code '_'} + * characters have special meanings. {@code '%'} means + * "match any substring of 0 or more characters". {@code '_'} means + * "match any character". Only metadata entries that match the pattern are + * returned. If such a search pattern string is set to {@code null}, that + * argument's criteria are dropped from the search. + * </p> + * + * @since Android 1.0 */ public interface DatabaseMetaData { /** - * States that it may not be permitted to store <code>NULL</code> values. + * States that it may not be permitted to store {@code NULL} values. + * + * @since Android 1.0 */ public static final short attributeNoNulls = 0; /** - * States that <code>NULL</code> values are definitely permitted. + * States that {@code NULL} values are definitely permitted. + * + * @since Android 1.0 */ public static final short attributeNullable = 1; /** - * States that whether <code>NULL</code> values are permitted is unknown. + * States that whether {@code NULL} values are permitted is unknown. + * + * @since Android 1.0 */ public static final short attributeNullableUnknown = 2; /** * States the best row identifier is <em>NOT</em> a pseudo column. + * + * @since Android 1.0 */ public static final int bestRowNotPseudo = 1; /** * States that the best row identifier is a pseudo column. + * + * @since Android 1.0 */ public static final int bestRowPseudo = 2; /** * States that the remainder of the current session is used as the scope for * the best row identifier. + * + * @since Android 1.0 */ public static final int bestRowSession = 2; /** * States that best row identifier scope lasts only while the row is being * used. + * + * @since Android 1.0 */ public static final int bestRowTemporary = 0; /** * States that the remainder of the current transaction is used as the scope * for the best row identifier. + * + * @since Android 1.0 */ public static final int bestRowTransaction = 1; /** * States that the best row identifier may or may not be a pseudo column. + * + * @since Android 1.0 */ public static final int bestRowUnknown = 0; /** - * States that the column might not allow <code>NULL</code> values. + * States that the column must not allow {@code NULL} values. + * + * @since Android 1.0 */ public static final int columnNoNulls = 0; /** - * States that the column definitely allows <code>NULL</code> values. + * States that the column definitely allows {@code NULL} values. + * + * @since Android 1.0 */ public static final int columnNullable = 1; /** * States that it is unknown whether the columns may be nulled. + * + * @since Android 1.0 */ public static final int columnNullableUnknown = 2; /** - * For the column UPDATE_RULE, States that when the primary key is updated, - * the foreign key (imported key) is changed to agree with it. + * For the column {@code UPDATE_RULE}, states that when the primary key is + * updated, the foreign key (imported key) is changed accordingly. + * + * @since Android 1.0 */ public static final int importedKeyCascade = 0; /** - * States deferrability. + * States that the evaluation of foreign key constraints is deferred (delayed + * until commit). + * + * @since Android 1.0 */ public static final int importedKeyInitiallyDeferred = 5; /** - * States defer-ability. + * States that the evaluation of foreign key constraint is {@code IMMEDIATE} + * . + * + * @since Android 1.0 */ public static final int importedKeyInitiallyImmediate = 6; /** - * For the columns UPDATE_RULE and DELETE_RULE, States that if the primary - * key has been imported, it cannot be updated or deleted. + * For the columns {@code UPDATE_RULE} and {@code DELETE_RULE}, states that + * if the primary key has been imported, it cannot be updated or deleted. + * + * @since Android 1.0 */ public static final int importedKeyNoAction = 3; /** - * States defer-ability. + * States that the evaluation of foreign key constraint must not be {@code + * DEFERRED}. + * + * @since Android 1.0 */ public static final int importedKeyNotDeferrable = 7; /** * States that a primary key must not be updated when imported as a foreign - * key by some other table. Used for the column UPDATE_RULE. + * key by some other table. Used for the column {@code UPDATE_RULE}. + * + * @since Android 1.0 */ public static final int importedKeyRestrict = 1; /** * States that when the primary key is modified (updated or deleted) the * foreign (imported) key is changed to its default value. Applies to the - * UPDATE_RULE and DELETE_RULE columns. + * {@code UPDATE_RULE} and {@code DELETE_RULE} columns. + * + * @since Android 1.0 */ public static final int importedKeySetDefault = 4; /** * States that when the primary key is modified (updated or deleted) the - * foreign (imported) key is changed to <code>NULL</code>. Applies to the - * UPDATE_RULE and DELETE_RULE columns. + * foreign (imported) key is changed to {@code NULL}. Applies to the {@code + * UPDATE_RULE} and {@code DELETE_RULE} columns. + * + * @since Android 1.0 */ public static final int importedKeySetNull = 2; /** - * States that this column stores IN type parameters. + * States that the column stores {@code IN} type parameters. + * + * @since Android 1.0 */ public static final int procedureColumnIn = 1; /** - * States that this column stores INOUT type parameters. + * States that this column stores {@code INOUT} type parameters. + * + * @since Android 1.0 */ public static final int procedureColumnInOut = 2; /** - * States that this column stores OUT type parameters. + * States that this column stores {@code OUT} type parameters. + * + * @since Android 1.0 */ public static final int procedureColumnOut = 4; /** - * States that the column stores results + * States that the column stores results. + * + * @since Android 1.0 */ public static final int procedureColumnResult = 3; /** * States that the column stores return values. + * + * @since Android 1.0 */ public static final int procedureColumnReturn = 5; /** * States that type of the column is unknown. + * + * @since Android 1.0 */ public static final int procedureColumnUnknown = 0; /** - * States that <code>NULL</code> values are not permitted. + * States that {@code NULL} values are not permitted. + * + * @since Android 1.0 */ public static final int procedureNoNulls = 0; /** * States that the procedure does not return a result. + * + * @since Android 1.0 */ public static final int procedureNoResult = 1; /** - * States that <code>NULL</code> values are permitted. + * States that {@code NULL} values are permitted. + * + * @since Android 1.0 */ public static final int procedureNullable = 1; /** - * States that whether <code>NULL</code> values are permitted is unknown. + * States that it is unknown whether {@code NULL} values are permitted. + * + * @since Android 1.0 */ public static final int procedureNullableUnknown = 2; /** * States that it is unknown whether or not the procedure returns a result. + * + * @since Android 1.0 */ public static final int procedureResultUnknown = 0; /** * States that the procedure returns a result. + * + * @since Android 1.0 */ public static final int procedureReturnsResult = 2; /** - * States that the value is an SQL99 SQLSTATE value. + * States that the value is an SQL99 {@code SQLSTATE} value. + * + * @since Android 1.0 */ public static final int sqlStateSQL99 = 2; /** - * States that the value is an SQL CLI SQLSTATE value as defined by X/Open - * (who are now know as Open Group) . + * States that the value is an SQL {@code CLI SQLSTATE} value as defined by + * the X/Open standard. + * + * @since Android 1.0 */ public static final int sqlStateXOpen = 1; /** * States that this table index is a clustered index. + * + * @since Android 1.0 */ public static final short tableIndexClustered = 1; /** * States that this table index is a hashed index. + * + * @since Android 1.0 */ public static final short tableIndexHashed = 2; /** * States this table's index is neither a clustered index, not a hashed * index, and not a table statistics index; i.e. it is something else. + * + * @since Android 1.0 */ public static final short tableIndexOther = 3; /** * States this column has the table's statistics, and that it is returned in * conjunction with the table's index description. + * + * @since Android 1.0 */ public static final short tableIndexStatistic = 0; /** - * States that a <code>NULL</code> value is <em>NOT</em> permitted for + * States that a {@code NULL} value is <em>NOT</em> permitted for * this data type. + * + * @since Android 1.0 */ public static final int typeNoNulls = 0; /** - * States that a <code>NULL</code> value is permitted for this data type. + * States that a {@code NULL} value is permitted for this data type. + * + * @since Android 1.0 */ public static final int typeNullable = 1; /** - * States that it is unknown if a <code>NULL</code> value is permitted for + * States that it is unknown if a {@code NULL} value is permitted for * this data type. + * + * @since Android 1.0 */ public static final int typeNullableUnknown = 2; /** - * States that one can base all WHERE search clauses except WHERE . + * States that this column shall not be used for {@code WHERE} statements + * with a {@code LIKE} clause. + * + * @since Android 1.0 */ public static final int typePredBasic = 2; /** - * States that <code>WHERE</code> is the only WHERE search clause that may - * be based on this type. + * States that this column can only be used in a {@code WHERE...LIKE} + * statement. + * + * @since Android 1.0 */ public static final int typePredChar = 1; /** - * States that this type does not support <code>WHERE</code> search - * clauses. + * States that this column does not support searches. + * + * @since Android 1.0 */ public static final int typePredNone = 0; /** - * States that all WHERE search clauses may be based on this type. + * States that the column is searchable. + * + * @since Android 1.0 */ public static final int typeSearchable = 3; @@ -292,35 +390,38 @@ public interface DatabaseMetaData { public static final int versionColumnUnknown = 0; /** - * Returns whether all procedures returned by <code>getProcedures</code> - * can be called by the current user. + * Returns whether all procedures returned by {@link #getProcedures} can be + * called by the current user. * - * @return <code>true</code> if all procedures can be called by the - * current user, <code>false</code> otherwise. + * @return {@code true} if all procedures can be called by the current user, + * {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean allProceduresAreCallable() throws SQLException; /** - * Returns whether all the tables returned by <code>getTables</code> can - * be used by the current user in a SELECT statement. + * Returns whether all the tables returned by {@code getTables} can be used + * by the current user in a {@code SELECT} statement. * - * @return <code>true</code> if all the tables can be used,<code>false</code> - * otherwise + * @return {@code true} if all the tables can be used,{@code false} + * otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean allTablesAreSelectable() throws SQLException; /** - * Returns if a data definition statement in a transaction forces a commit - * of the transaction. + * Returns whether a data definition statement in a transaction forces a {@code + * commit} of the transaction. * - * @return <code>true</code> if the statement forces a commit, - * <code>false</code> otherwise + * @return {@code true} if the statement forces a commit, {@code false} + * otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean dataDefinitionCausesTransactionCommit() throws SQLException; @@ -328,126 +429,129 @@ public interface DatabaseMetaData { * Returns whether the database ignores data definition statements within a * transaction. * - * @return <code>true</code> if the database ignores a data definition - * statement, <code>false</code> otherwise + * @return {@code true} if the database ignores a data definition statement, + * {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean dataDefinitionIgnoredInTransactions() throws SQLException; /** * Returns whether a visible row delete can be detected by calling - * <code>ResultSet.rowDeleted</code>. + * {@link ResultSet#rowDeleted}. * * @param type - * the type of the ResultSet involved: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if the visible row delete can be detected, - * <code>false</code> otherwise + * the type of the {@code ResultSet} involved: {@code + * ResultSet.TYPE_FORWARD_ONLY}, {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if the visible row delete can be detected, {@code + * false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean deletesAreDetected(int type) throws SQLException; /** - * Returns whether the return value of <code>getMaxRowSize</code> includes - * the SQL data types <code>LONGVARCHAR</code> and - * <code>LONGVARBINARY</code>. + * Returns whether the return value of {@code getMaxRowSize} includes the + * SQL data types {@code LONGVARCHAR} and {@code LONGVARBINARY}. * - * @return <code>true</code> if the return value includes - * <code>LONGVARBINARY</code> and <code>LONGVARCHAR</code>, - * otherwise <code>false</code>. + * @return {@code true} if the return value includes {@code LONGVARBINARY} + * and {@code LONGVARCHAR}, otherwise {@code false}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean doesMaxRowSizeIncludeBlobs() throws SQLException; /** - * Returns a description of the specified attribute of the specified type - * for an SQL User Defined Type (UDT) for a specified schema and catalog. - * The descriptions returned are ordered by <code>TYPE_SCHEM</code>, - * <code>TYPE_NAME</code> and ORDINAL_POSITION. The descriptions do not - * contain inherited attributes. + * Returns a {@code ResultSet} describing a subset of the attributes of a + * specified SQL User Defined Type (UDT) for a specified schema and catalog. + * The subset is determined by restricting to those attributes whose + * name matches the {@code attributeNamePattern} and whose type name + * matches the {@code typeNamePattern}. Each row of the {@code ResultSet} + * describes one attribute, and the rows are ordered by the columns {@code TYPE_SCHEM}, + * {@code TYPE_NAME} and {@code ORDINAL_POSITION}. Inherited attributes + * are not included. * <p> - * The returned ResultSet object has rows with the following column names - * and meanings: + * The columns of the returned {@code ResultSet} object have the following + * names and meanings: * <ol> - * <li><code>TYPE_CAT</code> - String - the Type Catalog name (possibly - * <code>null</code>)</li> - * <li><code>TYPE_SCHEM</code> - String - the Type Schema name (possibly - * <code>null</code>)</li> - * <li><code>TYPE_NAME</code> - String - the Type name</li> - * <li><code>ATTR_NAME</code> - String - the Attribute name</li> - * <li><code>DATA_TYPE</code> - int - the Attribute type as defined in - * <code>java.sql.Types</code></li> - * <li><code>ATTR_TYPE_NAME</code> - String - the Attribute type name. - * This depends on the data source. For a <code>UDT</code> the name is - * fully qualified. For a <code>REF</code> it is both fully qualified and - * represents the target type of the reference.</li> - * <li><code>ATTR_SIZE</code> - int - the Column size. When referring to - * char and date types this value is the maximum number of characters. When - * referring to numeric types is is the precision.</li> - * <li><code>DECIMAL_DIGITS</code> - int - how many fractional digits are + * <li>{@code TYPE_CAT} - String - the type catalog name (possibly {@code + * null})</li> + * <li>{@code TYPE_SCHEM} - String - the type schema name (possibly {@code + * null})</li> + * <li>{@code TYPE_NAME} - String - the type name</li> + * <li>{@code ATTR_NAME} - String - the attribute name</li> + * <li>{@code DATA_TYPE} - int - the attribute type as defined in {@code + * java.sql.Types}</li> + * <li>{@code ATTR_TYPE_NAME} - String - the attribute type name. This + * depends on the data source. For a {@code UDT} the name is fully + * qualified. For a {@code REF} it is both fully qualified and represents + * the target type of the reference.</li> + * <li>{@code ATTR_SIZE} - int - the column size. When referring to char and + * date types this value is the maximum number of characters. When referring + * to numeric types is is the precision.</li> + * <li>{@code DECIMAL_DIGITS} - int - how many fractional digits are * supported</li> - * <li><code>NUM_PREC_RADIX</code> - int - numeric values radix</li> - * <li><code>NULLABLE</code> - int - whether <code>NULL</code> is - * permitted: + * <li>{@code NUM_PREC_RADIX} - int - numeric values radix</li> + * <li>{@code NULLABLE} - int - whether {@code NULL} is permitted: * <ul> - * <li>DatabaseMetaData.attributeNoNulls - might not allow - * <code>NULL</code>s</li> - * <li>DatabaseMetaData.attributeNullable - <code>NULL</code>s - * definitely permitted</li> + * <li>DatabaseMetaData.attributeNoNulls - {@code NULL} values not permitted</li> + * <li>DatabaseMetaData.attributeNullable - {@code NULL} values definitely + * permitted</li> * <li>DatabaseMetaData.attributeNullableUnknown - unknown</li> * </ul> * </li> - * <li><code>REMARKS</code> - String - A comment describing the attribute - * (possibly <code>null</code>)</li> - * <li>ATTR_DEF - String - Default value for the attribute (possibly - * <code>null</code>)</li> - * <li><code>SQL_DATA_TYPE</code> - int - not used</li> + * <li>{@code REMARKS} - String - a comment describing the attribute + * (possibly {@code null})</li> + * <li>ATTR_DEF - String - Default value for the attribute (possibly {@code + * null})</li> + * <li>{@code SQL_DATA_TYPE} - int - not used</li> * <li>SQL_DATETIME_SUB - int - not used</li> - * <li>CHAR_OCTET_LENGTH - int - For <code>CHAR</code> types, the max - * number of bytes in the column</li> - * <li>ORDINAL_POSITION - int - The Index of the column in the Table (based - * on 1)</li> - * <li>IS_NULLABLE - String - "NO" = column does not allow - * <code>NULL</code>s, "YES" = column allows <code>NULL</code>s "" = - * <code>NULL</code> status unknown</li> - * <li><code>SCOPE_CATALOG</code> - String - Catalog for table, - * <code>SCOPE</code> of Reference attribute. NULL if - * <code>DATA_TYPE</code> is not REF.</li> - * <li><code>SCOPE_SCHEMA</code> - String - Schema for table, - * <code>SCOPE</code> of Reference attribute. NULL if - * <code>DATA_TYPE</code> is not REF.</li> - * <li><code>SCOPE_TABLE</code> - String - Table name for - * <code>SCOPE</code> of Reference attribute. <code>NULL</code> if - * <code>DATA_TYPE</code> is not REF.</li> - * <li><code>SOURCE_DATA_TYPE</code> - String - The source type for user - * generated REF type or for a Distinct type. (<code>NULL</code> if - * <code>DATA_TYPE</code> is not DISTINCT or user generated REF)</li> + * <li>CHAR_OCTET_LENGTH - int - for {@code CHAR} types, the max number of + * bytes in the column</li> + * <li>ORDINAL_POSITION - int - The index of the column in the table (where + * the count starts from 1, not 0)</li> + * <li>IS_NULLABLE - String - {@code "NO"} = the column does not allow {@code + * NULL}s, {@code "YES"} = the column allows {@code NULL}s, "" = status unknown</li> + * <li>{@code SCOPE_CATALOG} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the catalog of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SCOPE_SCHEMA} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the schema of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SCOPE_TABLE} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the name of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SOURCE_DATA_TYPE} - String - The source type for a user + * generated REF type or for a Distinct type. ({@code NULL} if {@code + * DATA_TYPE} is not DISTINCT or a user generated REF)</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by a schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param typeNamePattern - * a Type name. This pattern must match the type name stored in + * a type name. This pattern must match the type name stored in * the database. * @param attributeNamePattern - * an Attribute name. Must match the attribute name as stored in + * an Attribute name. This pattern must match the attribute name as stored in * the database. - * @return a ResultSet, where each Row is an attribute description + * @return a {@code ResultSet}, where each row is an attribute description. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) @@ -455,66 +559,64 @@ public interface DatabaseMetaData { /** * Returns a list of a table's optimal set of columns that uniquely - * identifies a row. The results are ordered by <code>SCOPE</code> (see - * below). + * identify the rows. The results are ordered by {@code SCOPE} (see below). * <p> * The results are returned as a table, with one entry for each column, as * follows: * <ol> - * <li><code>SCOPE</code> - short - the <code>SCOPE</code> of the - * result, as follows: + * <li>{@code SCOPE} - short - the {@code SCOPE} of the result, as follows: * <ul> - * <li>DatabaseMetaData.bestRowTemporary - very temporary, while using row - * </li> - * <li>DatabaseMetaData.bestRowTransaction - good for remainder of current - * transaction </li> - * <li>DatabaseMetaData.bestRowSession - good for remainder of database - * session </li> + * <li>{@code DatabaseMetaData.bestRowTemporary} - the result is very temporary, + * only valid while on the current row</li> + * <li>{@code DatabaseMetaData.bestRowTransaction} - the result is good for remainder of + * current transaction</li> + * <li>{@code DatabaseMetaData.bestRowSession} - the result is good for remainder of + * database session</li> * </ul> * </li> - * <li><code>COLUMN_NAME</code> - String - the column name </li> - * <li><code>DATA_TYPE</code> - int - the Type of the data, as defined in - * <code>java.sql.Types</code> </li> - * <li><code>TYPE_NAME</code> - String - Name of the type - database - * dependent. For UDT types the name is fully qualified </li> - * <li><code>COLUMN_SIZE</code> - int - The precision of the data in the - * column </li> - * <li><code>BUFFER_LENGTH</code> - int - not used </li> - * <li><code>DECIMAL_DIGITS</code> - short - number of fractional digits - * </li> - * <li><code>PSEUDO_COLUMN</code> - short - whether this is a pseudo - * column eg. and Oracle ROWID: + * <li>{@code COLUMN_NAME} - String - the column name</li> + * <li>{@code DATA_TYPE} - int - the Type of the data, as defined in {@code + * java.sql.Types}</li> + * <li>{@code TYPE_NAME} - String - the Name of the type - database dependent. + * For UDT types the name is fully qualified</li> + * <li>{@code COLUMN_SIZE} - int - the precision of the data in the column</li> + * <li>{@code BUFFER_LENGTH} - int - not used</li> + * <li>{@code DECIMAL_DIGITS} - short - number of fractional digits</li> + * <li>{@code PSEUDO_COLUMN} - short - whether this is a pseudo column (e.g. + * an Oracle {@code ROWID}): * <ul> - * <li>DatabaseMetaData.bestRowUnknown - don't know whether this is a - * pseudo column</li> - * <li>DatabaseMetaData.bestRowNotPseudo - column is not pseudo</li> - * <li>DatabaseMetaData.bestRowPseudo - column is a pseudo column</li> + * <li>{@code DatabaseMetaData.bestRowUnknown} - it is not known whether this is + * a pseudo column</li> + * <li>{@code DatabaseMetaData.bestRowNotPseudo} - the column is not pseudo</li> + * <li>{@code DatabaseMetaData.bestRowPseudo} - the column is a pseudo column</li> * </ul> * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param table * the table name. This must match the name of the table as * declared in the database. * @param scope - * the <code>SCOPE</code> of interest, values as defined above + * the {@code SCOPE} of interest, values as defined above. * @param nullable - * <code>true</code> = include columns that are nullable, - * <code>false</code> = do not include - * @return a ResultSet where each row is a description of a column and the - * complete set of rows is the optimal set for this table. + * {@code true} = include columns that are nullable, {@code + * false} = do not include nullable columns. + * @return a {@code ResultSet} where each row is a description of a column + * and the complete set of rows is the optimal set for this table. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException; @@ -523,11 +625,12 @@ public interface DatabaseMetaData { * Returns the set of catalog names available in this database. The set is * returned ordered by catalog name. * - * @return a ResultSet containing the Catalog names, with each row - * containing one Catalog name contained as a String in the single - * column named <code>TABLE_CAT</code>. + * @return a {@code ResultSet} containing the catalog names, with each row + * containing one catalog name (as a {@code String}) in the + * single column named {@code TABLE_CAT}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getCatalogs() throws SQLException; @@ -535,18 +638,20 @@ public interface DatabaseMetaData { * Returns the separator that this database uses between a catalog name and * table name. * - * @return a String containing the separator + * @return a String containing the separator. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getCatalogSeparator() throws SQLException; /** * Returns the term that the database vendor prefers term for "catalog". * - * @return a String with the vendor's term for "catalog" + * @return a String with the vendor's term for "catalog". * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getCatalogTerm() throws SQLException; @@ -554,128 +659,124 @@ public interface DatabaseMetaData { * Returns a description of access rights for a table's columns. Only access * rights matching the criteria for the column name are returned. * <p> - * The description is returned as a ResultSet with rows of data for each - * access right, with columns as follows: + * The description is returned as a {@code ResultSet} with rows of data for + * each access right, with columns as follows: * <ol> - * <li><code>TABLE_CAT</code> - String - Catalog name (possibly - * <code>null</code>)</li> - * <li><code>TABLE_SCHEM</code> - String - Schema name (possibly - * <code>null</code>) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>COLUMN_NAME</code> - String - The Column name</li> - * <li><code>GRANTOR</code> - String - The grantor of access (possibly - * <code>null</code>)</li> - * <li><code>PRIVILEGE</code> - String - Access right - one of SELECT, - * INSERT, UPDATE, REFERENCES,...</li> - * <li><code>IS_GRANTABLE</code> - String - "YES" implies that the - * receiver can grant access to others, "NO" if the receiver cannot grant - * access to others, <code>null</code> if unknown.</li> + * <li>{@code TABLE_CAT} - String - the catalog name (possibly {@code null})</li> + * <li>{@code TABLE_SCHEM} - String - the schema name (possibly {@code null})</li> + * <li>{@code TABLE_NAME} - String - the table name</li> + * <li>{@code COLUMN_NAME} - String - the Column name</li> + * <li>{@code GRANTOR} - String - the grantor of access (possibly {@code + * null})</li> + * <li>{@code PRIVILEGE} - String - Access right - one of SELECT, INSERT, + * UPDATE, REFERENCES,...</li> + * <li>{@code IS_GRANTABLE} - String - {@code "YES"} implies that the + * receiver can grant access to others, {@code "NO"} if the receiver cannot + * grant access to others, {@code null} if unknown.</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param table * the table name. This must match the name of the table as * declared in the database. * @param columnNamePattern * the column name. This must match the name of a column in the * table in the database. - * @return a ResultSet containing the access rights, one row for each - * privilege description + * @return a {@code ResultSet} containing the access rights, one row for + * each privilege description. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException; /** * Returns a description of table columns available in a specified catalog. - * Only descriptions meeting the specified Catalog, Schema, Table and Column + * Only descriptions meeting the specified catalog, schema, table, and column * names are returned. * <p> - * The descriptions are returned as a ResultSet conforming to the following - * data layout, with one row per table column: + * The descriptions are returned as a {@code ResultSet} conforming to the + * following data layout, with one row per table column: * <ol> - * <li><code>TABLE_CAT</code> - String - Catalog name (possibly - * <code>null</code>)</li> - * <li><code>TABLE_SCHEM</code> - String - Schema name (possibly - * <code>null</code>) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>COLUMN_NAME</code> - String - The Column name</li> - * <li><code>DATA_TYPE</code> - int - The SQL type as specified in - * <code>java.sql.Types</code></li> - * <li><code>TYPE_NAME</code> - String - Name for the data type, depends - * on database, UDT names are fully qualified</li> - * <li><code>COLUMN_SIZE</code> - int - Column size - the precision for - * numeric types, max characters for char and date types</li> - * <li><code>BUFFER_LENGTH</code> - int - Not used </li> - * <li><code>DECIMAL_DIGITS</code> - int - maximum number of fractional - * digits </li> - * <li><code>NUM_PREC_RADIX</code> - int - the Radix </li> - * <li><code>NULLABLE</code> - int - does the column allow - * <code>null</code>s: + * <li>{@code TABLE_CAT} - String - the catalog name (possibly {@code null})</li> + * <li>{@code TABLE_SCHEM} - String - the schema name (possibly {@code null})</li> + * <li>{@code TABLE_NAME} - String - the table name</li> + * <li>{@code COLUMN_NAME} - String - the column name</li> + * <li>{@code DATA_TYPE} - int - the SQL type as specified in {@code + * java.sql.Types}</li> + * <li>{@code TYPE_NAME} - String - the name of the data type, (database-dependent, + * UDT names are fully qualified)</li> + * <li>{@code COLUMN_SIZE} - int - the column size (the precision for numeric + * types, max characters for {@code char} and {@code date} types)</li> + * <li>{@code BUFFER_LENGTH} - int - Not used</li> + * <li>{@code DECIMAL_DIGITS} - int - maximum number of fractional digits</li> + * <li>{@code NUM_PREC_RADIX} - int - the radix for numerical types</li> + * <li>{@code NULLABLE} - int - whether the column allows {@code null}s: * <ul> - * <li>DatabaseMetaData.columnNoNulls = may not allow <code>NULL</code>s</li> - * <li>DatabaseMetaData.columnNullable = does allow <code>NULL</code>s</li> - * <li>DatabaseMetaData.columnNullableUnknown = unknown <code>NULL</code> - * status</li> + * <li>DatabaseMetaData.columnNoNulls = may not allow {@code NULL}s</li> + * <li>DatabaseMetaData.columnNullable = does allow {@code NULL}s</li> + * <li>DatabaseMetaData.columnNullableUnknown = unknown {@code NULL} status</li> * </ul> * </li> - * <li><code>REMARKS</code> - String - A description of the column - * (possibly <code>null</code>) </li> - * <li><code>COLUMN_DEF</code> - String - Default value for the column - * (possibly <code>null</code>)</li> - * <li><code>SQL_DATA_TYPE</code> - int - not used </li> - * <li><code>SQL_DATETIME_SUB</code> - int - not used </li> - * <li><code>CHAR_OCTET_LENGTH</code> - int - maximum number of bytes in - * the char type columns </li> - * <li><code>ORDINAL_POSITION</code> - int - Column index in the table (1 - * based) </li> - * <li><code>IS_NULLABLE</code> - String - "NO" = column does not allow - * NULLs, "YES" = column allows NULLs "" = <code>NULL</code> status + * <li>{@code REMARKS} - String - A description of the column (possibly + * {@code null})</li> + * <li>{@code COLUMN_DEF} - String - Default value for the column (possibly + * {@code null})</li> + * <li>{@code SQL_DATA_TYPE} - int - not used</li> + * <li>{@code SQL_DATETIME_SUB} - int - not used</li> + * <li>{@code CHAR_OCTET_LENGTH} - int - maximum number of bytes in the + * {@code char} type columns</li> + * <li>{@code ORDINAL_POSITION} - int - the column index in the table (1 based)</li> + * <li>{@code IS_NULLABLE} - String - {@code "NO"} = column does not allow + * NULLs, {@code "YES"} = column allows NULLs, "" = {@code NULL} status * unknown</li> - * <li><code>SCOPE</code>_CATALOG - String - Catalog for table, - * <code>SCOPE</code> of Reference attribute. NULL if - * <code>DATA_TYPE</code> is not REF.</li> - * <li><code>SCOPE_SCHEMA</code> - String - Schema for table, scope of - * Reference attribute. <code>NULL</code> if <code>DATA_TYPE</code> is - * not REF.</li> - * <li><code>SCOPE_TABLE</code> - String - Table name for scope of - * Reference attribute. <code>NULL</code> if <code>DATA_TYPE</code> is - * not REF.</li> - * <li><code>SOURCE_DATA_TYPE</code> - String - The source type for user - * generated REF type or for a Distinct type. (<code>NULL</code> if - * <code>DATA_TYPE</code> is not DISTINCT or user generated REF)</li> + * <li>{@code SCOPE_CATALOG} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the catalog of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SCOPE_SCHEMA} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the schema of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SCOPE_TABLE} - String - if the {@code DATA_TYPE} is {@code REF}, + * this gives the name of the table corresponding to the attribute's scope. + * NULL if the {@code DATA_TYPE} is not REF.</li> + * <li>{@code SOURCE_DATA_TYPE} - String - The source type for a user + * generated REF type or for a Distinct type. ({@code NULL} if {@code + * DATA_TYPE} is not DISTINCT or a user generated REF)</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param tableNamePattern * the table name. This must match the name of the table as * declared in the database. * @param columnNamePattern * the column name. This must match the name of a column in the * table in the database. - * @return the descriptions as a ResultSet with rows in the form defined - * above + * @return the descriptions as a {@code ResultSet} with rows in the form + * defined above. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) @@ -684,9 +785,10 @@ public interface DatabaseMetaData { /** * Returns the database connection that created this metadata. * - * @return the connection + * @return the connection to the database. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public Connection getConnection() throws SQLException; @@ -696,96 +798,98 @@ public interface DatabaseMetaData { * describes how one table imports the key of another table. It would be * expected to return a single foreign key - primary key pair in most cases. * <p> - * The descriptions are returned as a ResultSet with one row for each - * Foreign key, with the following layout: + * The descriptions are returned as a {@code ResultSet} with one row for + * each foreign key, with the following layout: * <ol> - * <li><code>PKTABLE_CAT</code> - String - from the primary key table : - * Catalog (possibly <code>null</code>)</li> - * <li><code>PKTABLE_SCHEM</code> - String - from the primary key table : - * Schema (possibly <code>null</code>) </li> - * <li><code>PKTABLE_NAME</code> - String - primary key table : name - * </li> - * <li><code>PKCOLUMN_NAME</code> - String - primary key column : name</li> - * <li><code>FKTABLE_CAT</code> - String - from the foreign key table : - * the catalog name being exported (possibly <code>null</code>)</li> - * <li><code>FKTABLE_SCHEM</code> - String - foreign key table : Schema - * name being exported (possibly <code>null</code>) </li> - * <li><code>FKTABLE_NAME</code> - String - foreign key table : the name - * being exported</li> - * <li><code>FKCOLUMN_NAME</code> - String - foreign key column : the - * name being exported</li> - * <li><code>KEY_SEQ</code> - short - sequence number (in the foreign - * key)</li> - * <li><code>UPDATE_RULE</code> - short - how to treat foreign key when - * primary key is updated: + * <li>{@code PKTABLE_CAT} - String - from the primary key table : Catalog + * (possibly {@code null})</li> + * <li>{@code PKTABLE_SCHEM} - String - from the primary key table : Schema + * (possibly {@code null})</li> + * <li>{@code PKTABLE_NAME} - String - from the primary key table : name</li> + * <li>{@code PKCOLUMN_NAME} - String - from the primary key column : name</li> + * <li>{@code FKTABLE_CAT} - String - from the foreign key table : the + * catalog name being exported (possibly {@code null})</li> + * <li>{@code FKTABLE_SCHEM} - String - from the foreign key table : the schema name + * being exported (possibly {@code null})</li> + * <li>{@code FKTABLE_NAME} - String - from the foreign key table : the name being + * exported</li> + * <li>{@code FKCOLUMN_NAME} - String - from the foreign key column : the name being + * exported</li> + * <li>{@code KEY_SEQ} - short - the sequence number (in the foreign key)</li> + * <li>{@code UPDATE_RULE} - short - a value giving the rule for how to treat the corresponding foreign key when a primary + * key is updated: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow update of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - change imported key to match - * the primary key update</li> - * <li>DatabaseMetaData.importedKeySetNull - set the imported key to - * <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - set the imported key to - * default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the + * primary key to be updated if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - change the imported key to + * match the updated primary key</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to + * {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key + * to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as {@code + * importedKeyNoAction}</li> * </ul> * </li> - * <li><code>DELETE_RULE</code> - short - how to treat foreign key when - * primary key is deleted: + * <li>{@code DELETE_RULE} - short - a value giving the rule for how to treat the foreign key when the corresponding primary + * key is deleted: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow delete of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - delete those rows that import - * a deleted key</li> - * <li>DatabaseMetaData.importedKeySetNull - set the imported key to - * <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - set the imported key to - * default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the + * primary key to be deleted if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - delete those rows that + * import a deleted key</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to + * {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key + * to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as + * importedKeyNoAction</li> * </ul> * </li> - * <li>FK_NAME - String - foreign key name (possibly <code>null</code>)</li> - * <li>PK_NAME - String - primary key name (possibly <code>null</code>)</li> - * <li>DEFERRABILITY - short - can foreign key constraints be deferred - * until commit (see SQL92 specification for definitions)?: + * <li>{@code FK_NAME} - String - the foreign key name (possibly {@code null})</li> + * <li>{@code PK_NAME} - String - the primary key name (possibly {@code null})</li> + * <li>{@code DEFERRABILITY} - short - whether foreign key constraints can be + * deferred until commit (see the SQL92 specification for definitions): * <ul> - * <li>DatabaseMetaData.importedKeyInitiallyDeferred</li> - * <li>DatabaseMetaData.importedKeyInitiallyImmediate</li> - * <li>DatabaseMetaData.importedKeyNotDeferrable</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> + * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> * </ul> * </li> * </ol> + * </p> * * @param primaryCatalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name for the primary key table. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param primarySchema - * a Schema Name. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name for the primary key table. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with "" used to retrieve those + * without a schema name. * @param primaryTable * the name of the table which exports the key. It must match the - * name of the table in the database + * name of the table in the database. * @param foreignCatalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name for the foreign key table. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param foreignSchema - * a Schema Name. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name for the foreign key table. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with "" used to retrieve those + * without a schema name. * @param foreignTable * the name of the table importing the key. It must match the - * name of the table in the database - * @return a ResultSet containing rows with the descriptions of the foreign - * keys laid out according to the format defined above. + * name of the table in the database. + * @return a {@code ResultSet} containing rows with the descriptions of the + * foreign keys laid out according to the format defined above. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, @@ -794,83 +898,95 @@ public interface DatabaseMetaData { /** * Returns the major version number of the database software. * - * @return the Major version number of the database software. + * @return the major version number of the database software. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getDatabaseMajorVersion() throws SQLException; /** * Returns the minor version number of the database software. * - * @return the Minor version number of the database software. + * @return the minor version number of the database software. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getDatabaseMinorVersion() throws SQLException; /** * Returns the name of the database software. * - * @return a String with the name of the database software. + * @return a {@code String} with the name of the database software. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getDatabaseProductName() throws SQLException; /** * Returns the version number of this database software. * - * @return a String with the version number of the database software. + * @return a {@code String} with the version number of the database + * software. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getDatabaseProductVersion() throws SQLException; /** * Returns the default transaction isolation level for this database. * - * @return the default transaction isolation level. One of - * <code>TRANSACTION_NONE</code>, - * <code>TRANSACTION_READ_COMMITTED</code>, - * <code>TRANSACTION_READ_UNCOMMITTED</code>, - * <code>TRANSACTION_REPEATABLE_READ</code> or - * <code>TRANSACTION_SERIALIZABLE</code>. + * @return the default transaction isolation level. One of the following values: + * <ul> + * <li>{@code TRANSACTION_NONE}</li> + * <li>{@code TRANSACTION_READ_COMMITTED}</li> + * <li>{@code TRANSACTION_READ_UNCOMMITTED}</li> + * <li>{@code TRANSACTION_REPEATABLE_READ}</li> + * <li>{@code TRANSACTION_SERIALIZABLE}</li> + * </ul> * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getDefaultTransactionIsolation() throws SQLException; /** * Returns the JDBC driver's major version number. * - * @return the driver's major version number + * @return the driver's major version number. + * @since Android 1.0 */ public int getDriverMajorVersion(); /** * Returns the JDBC driver's minor version number. * - * @return the driver's minor version number + * @return the driver's minor version number. + * @since Android 1.0 */ public int getDriverMinorVersion(); /** * Returns the name of this JDBC driver. * - * @return a String containing the name of the JDBC driver + * @return a {@code String} containing the name of the JDBC driver * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getDriverName() throws SQLException; /** * Returns the version number of this JDBC driver. * - * @return a String containing the complete version number of the JDBC - * driver + * @return a {@code String} containing the complete version number of the + * JDBC driver. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getDriverVersion() throws SQLException; @@ -878,95 +994,101 @@ public interface DatabaseMetaData { * Returns a list of the foreign key columns that reference the primary key * columns of a specified table (the foreign keys exported by a table). * <p> - * The list is returned as a ResultSet with a row for each of the foreign - * key columns, ordered by <code>FKTABLE_CAT</code>, - * <code>FKTABLE_SCHEM</code>, <code>FKTABLE_NAME</code>, and - * <code>KEY_SEQ</code>, with the format for each row being: + * The list is returned as a {@code ResultSet} with a row for each of the + * foreign key columns, ordered by {@code FKTABLE_CAT}, {@code + * FKTABLE_SCHEM}, {@code FKTABLE_NAME}, and {@code KEY_SEQ}, with the + * format for each row being: * <ol> - * <li><code>PKTABLE_CAT</code> - String - primary key table : Catalog - * (possibly <code>null</code>)</li> - * <li><code>PKTABLE_SCHEM</code> - String - primary key table : Schema - * (possibly <code>null</code>) </li> - * <li><code>PKTABLE_NAME</code> - String - primary key table : name - * </li> - * <li><code>PKCOLUMN_NAME</code> - String - primary key column : name</li> - * <li><code>FKTABLE_CAT</code> - String - foreign key table : Catalog - * name being exported (possibly <code>null</code>)</li> - * <li><code>FKTABLE_SCHEM</code> - String - foreign key table : Schema - * name being exported (possibly <code>null</code>) </li> - * <li><code>FKTABLE_NAME</code> - String - foreign key table : name - * being exported</li> - * <li><code>FKCOLUMN_NAME</code> - String - foreign key column : name - * being exported</li> - * <li>KEY_SEQ - short - sequence number in the foreign key</li> - * <li>UPDATE_RULE - short - how to treat foreign key when primary key is - * updated: + * <li>{@code PKTABLE_CAT} - String - from the primary key table : the catalog (possibly + * {@code null})</li> + * <li>{@code PKTABLE_SCHEM} - String - from the primary key table : the schema (possibly + * {@code null})</li> + * <li>{@code PKTABLE_NAME} - String - from the primary key table : the name</li> + * <li>{@code PKCOLUMN_NAME} - String - from the primary key column : the name</li> + * <li>{@code FKTABLE_CAT} - String - from the foreign key table : the catalog name being + * exported (possibly {@code null})</li> + * <li>{@code FKTABLE_SCHEM} - String - from the foreign key table : the schema name + * being exported (possibly {@code null})</li> + * <li>{@code FKTABLE_NAME} - String - from the foreign key table : the name being + * exported</li> + * <li>{@code FKCOLUMN_NAME} - String - from the foreign key column : the name being + * exported</li> + * <li>{@code KEY_SEQ} - short - the sequence number (in the foreign key)</li> + * <li>{@code UPDATE_RULE} - short - a value giving the rule for how to treat the foreign key when the corresponding primary + * key is updated: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow update of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - change imported key to match - * the primary key update</li> - * <li>DatabaseMetaData.importedKeySetNull - set the imported key to - * <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - set the imported key to - * default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the + * primary key to be updated if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - change the imported key to + * match the primary key update</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to + * {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key + * to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as + * importedKeyNoAction</li> * </ul> * </li> - * <li>DELETE_RULE - short - how to treat foreign key when primary key is - * deleted: + * <li>{@code DELETE_RULE} - short - how to treat the foreign key when the corresponding primary + * key is deleted: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow delete of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - the deletion should also - * delete rows that import a deleted key</li> - * <li>DatabaseMetaData.importedKeySetNull - it should set the imported key - * to <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - deletion sets the imported - * key to default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the + * primary key to be deleted if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - the deletion should + * also delete rows that import a deleted key</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - the deletion sets the + * imported key to {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - the deletion sets the + * imported key to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as + * importedKeyNoAction</li> * </ul> * </li> - * <li>FK_NAME - String - foreign key name (possibly <code>null</code>)</li> - * <li>PK_NAME - String - primary key name (possibly <code>null</code>)</li> - * <li>DEFERRABILITY - short - defines whether foreign key constraints can - * be deferred until commit (see SQL92 specification for definitions): + * <li>{@code FK_NAME} - String - the foreign key name (possibly {@code null})</li> + * <li>{@code PK_NAME} - String - the primary key name (possibly {@code null})</li> + * <li>{@code DEFERRABILITY} - short - defines whether the foreign key + * constraints can be deferred until commit (see the SQL92 specification for + * definitions): * <ul> - * <li>DatabaseMetaData.importedKeyInitiallyDeferred</li> - * <li>DatabaseMetaData.importedKeyInitiallyImmediate</li> - * <li>DatabaseMetaData.importedKeyNotDeferrable</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> + * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> * </ul> * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with "" used to retrieve those + * without a schema name. * @param table * a table name, which must match the name of a table in the * database - * @return a ResultSet containing a row for each of the foreign key columns, - * as defined above + * @return a {@code ResultSet} containing a row for each of the foreign key + * columns, as defined above * @throws SQLException * a database error occurred + * @since Android 1.0 */ public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException; /** * Returns a string of characters that may be used in unquoted identifier - * names. The characters a-z, A-Z, 0-9 and _ are always permitted. + * names. The characters {@code a-z}, {@code A-Z}, {@code 0-9} and {@code _} + * are always permitted. * - * @return a String containing all the extra characters + * @return a String containing all the additional permitted characters. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getExtraNameCharacters() throws SQLException; @@ -976,7 +1098,8 @@ public interface DatabaseMetaData { * * @return the String used to quote SQL identifiers. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getIdentifierQuoteString() throws SQLException; @@ -985,83 +1108,87 @@ public interface DatabaseMetaData { * referenced by the table's foreign key columns (that is, the primary keys * imported by a table). * <p> - * The list returned is a <code>ResultSet</code> with a row entry for each - * primary key column, ordered by <code>PKTABLE_CAT</code>, - * <code>PKTABLE_SCHEM</code>, <code>PKTABLE_NAME</code>, and - * <code>KEY_SEQ</code>, with the following format: + * The list returned is a {@code ResultSet} with a row entry for each + * primary key column, ordered by {@code PKTABLE_CAT}, {@code PKTABLE_SCHEM}, + * {@code PKTABLE_NAME}, and {@code KEY_SEQ}, with the following format: * <ol> - * <li><code>PKTABLE_CAT</code> - String - primary key Catalog name being - * imported (possibly <code>null</code>)</li> - * <li><code>PKTABLE_SCHEM</code> - String - primary key Schema name - * being imported (possibly <code>null</code>) </li> - * <li><code>PKTABLE_NAME</code> - String - primary key Table name being - * imported </li> - * <li><code>PKCOLUMN_NAME</code> - String - primary key column name - * being imported</li> - * <li><code>FKTABLE_CAT</code> - String - foreign key table catalog name - * (possibly <code>null</code>)</li> - * <li><code>FKTABLE_SCHEM</code> - String - foreign key table Schema - * name (possibly <code>null</code>) </li> - * <li><code>FKTABLE_NAME</code> - String - foreign key table name</li> - * <li><code>FKCOLUMN_NAME</code> - String - foreign key column name</li> - * <li>KEY_SEQ - short - sequence number in the foreign key</li> - * <li>UPDATE_RULE - short - how to treat foreign key when primary key is - * updated: + * <li>{@code PKTABLE_CAT} - String - primary key catalog name being + * imported (possibly {@code null})</li> + * <li>{@code PKTABLE_SCHEM} - String - primary key schema name being + * imported (possibly {@code null})</li> + * <li>{@code PKTABLE_NAME} - String - primary key table name being imported + * </li> + * <li>{@code PKCOLUMN_NAME} - String - primary key column name being + * imported</li> + * <li>{@code FKTABLE_CAT} - String - foreign key table catalog name + * (possibly {@code null})</li> + * <li>{@code FKTABLE_SCHEM} - String - foreign key table schema name + * (possibly {@code null})</li> + * <li>{@code FKTABLE_NAME} - String - foreign key table name</li> + * <li>{@code FKCOLUMN_NAME} - String - foreign key column name</li> + * <li>{@code KEY_SEQ} - short - sequence number (in the foreign key)</li> + * <li>{@code UPDATE_RULE} - short - how to treat the foreign key when the corresponding primary + * key is updated: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow update of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - change imported key to match - * the primary key update</li> - * <li>DatabaseMetaData.importedKeySetNull - set the imported key to - * <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - set the imported key to - * default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow any update of + * the primary key if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - change imported key to + * match the primary key update</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to + * {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key + * to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as + * importedKeyNoAction</li> * </ul> * </li> - * <li>DELETE_RULE - short - how to treat foreign key when primary key is - * deleted: + * <li>{@code DELETE_RULE} - short - how to treat the foreign key when the corresponding primary + * key is deleted: * <ul> - * <li>DatabaseMetaData.importedKeyNoAction - don't allow delete of primary - * key if imported</li> - * <li>DatabaseMetaData.importedKeyCascade - delete those rows that import - * a deleted key</li> - * <li>DatabaseMetaData.importedKeySetNull - set the imported key to - * <code>null</code></li> - * <li>DatabaseMetaData.importedKeySetDefault - set the imported key to - * default values</li> - * <li>DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction</li> + * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the primary key to be deleted + * if it is imported as a foreign key</li> + * <li>{@code DatabaseMetaData.importedKeyCascade} - delete those rows that + * import a deleted key</li> + * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to + * {@code null}</li> + * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key + * to its default value</li> + * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as {@code + * importedKeyNoAction}</li> * </ul> * </li> - * <li>FK_NAME - String - foreign key name (possibly <code>null</code>)</li> - * <li>PK_NAME - String - primary key name (possibly <code>null</code>)</li> - * <li>DEFERRABILITY - short - defines whether foreign key constraints can - * be deferred until commit (see SQL92 specification for definitions): + * <li>{@code FK_NAME} - String - foreign key name (possibly {@code null})</li> + * <li>{@code PK_NAME} - String - primary key name (possibly {@code null})</li> + * <li>{@code DEFERRABILITY} - short - defines whether foreign key + * constraints can be deferred until commit (see SQL92 specification for + * definitions): * <ul> - * <li>DatabaseMetaData.importedKeyInitiallyDeferred</li> - * <li>DatabaseMetaData.importedKeyInitiallyImmediate</li> - * <li>DatabaseMetaData.importedKeyNotDeferrable</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> + * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> + * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> * </ul> * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with "" used to retrieve those + * without a schema name. * @param table * a table name, which must match the name of a table in the - * database - * @return a ResultSet containing the list of primary key columns as rows in - * the format defined above. + * database. + * @return a {@code ResultSet} containing the list of primary key columns as + * rows in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException; @@ -1069,70 +1196,73 @@ public interface DatabaseMetaData { /** * Returns a list of indices and statistics for a specified table. * <p> - * The list is returned as a ResultSet, with one row for each index or - * statistic. The list is ordered by NON_UNIQUE, TYPE, INDEX_NAME, and - * ORDINAL_POSITION. Each row has the following format: + * The list is returned as a {@code ResultSet}, with one row for each index + * or statistic. The list is ordered by {@code NON_UNIQUE}, {@code TYPE}, + * {@code INDEX_NAME}, and {@code ORDINAL_POSITION}. Each row has the + * following format: * <ol> - * <li><code>TABLE_CAT</code> - String - table catalog name (possibly - * <code>null</code>)</li> - * <li><code>TABLE_SCHEM</code> - String - Table Schema name (possibly - * <code>null</code>) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>NON_UNIQUE</code> - boolean - <code>true</code> when index - * values can be non-unique. Must be <code>false</code> when TYPE is - * tableIndexStatistic</li> - * <li><code>INDEX_QUALIFIER</code> - String : index catalog name. - * <code>null</code> when TYPE is 'tableIndexStatistic'</li> - * <li><code>INDEX_NAME</code> - String : index name. <code>null</code> - * when TYPE is 'tableIndexStatistic'</li> - * <li>TYPE - short - the index type. One of: + * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code + * null})</li> + * <li>{@code TABLE_SCHEM} - String - table schema name (possibly {@code + * null})</li> + * <li>{@code TABLE_NAME} - String - The table name</li> + * <li>{@code NON_UNIQUE} - boolean - {@code true} when index values can be + * non-unique. Must be {@code false} when the TYPE is tableIndexStatistic</li> + * <li>{@code INDEX_QUALIFIER} - String : index catalog name. {@code null} + * when the TYPE is 'tableIndexStatistic'</li> + * <li>{@code INDEX_NAME} - String : index name. {@code null} when TYPE is + * 'tableIndexStatistic'</li> + * <li>{@code TYPE} - short - the index type. One of: * <ul> - * <li>DatabaseMetaData.tableIndexStatistic - table statistics returned - * with Index descriptions</li> - * <li>DatabaseMetaData.tableIndexClustered - a clustered Index</li> - * <li>DatabaseMetaData.tableIndexHashed - a hashed Index</li> - * <li>DatabaseMetaData.tableIndexOther - other style of Index</li> + * <li>{@code DatabaseMetaData.tableIndexStatistic} - table statistics + * returned with Index descriptions</li> + * <li>{@code DatabaseMetaData.tableIndexClustered} - a clustered Index</li> + * <li>{@code DatabaseMetaData.tableIndexHashed} - a hashed Index</li> + * <li>{@code DatabaseMetaData.tableIndexOther} - other style of Index</li> * </ul> * </li> - * <li>ORDINAL_POSITION - short - column sequence within Index. 0 when TYPE - * is tableIndexStatistic </li> - * <li><code>COLUMN_NAME</code> - String - the column name. - * <code>null</code> when TYPE is tableIndexStatistic</li> - * <li>ASC_OR_DESC - String - column sort sequence. <code>null</code> if + * <li>{@code ORDINAL_POSITION} - short - column sequence within Index. 0 + * when TYPE is tableIndexStatistic</li> + * <li>{@code COLUMN_NAME} - String - the column name. {@code null} when + * TYPE is tableIndexStatistic</li> + * <li>{@code ASC_OR_DESC} - String - column sort sequence. {@code null} if * sequencing not supported or TYPE is tableIndexStatistic; otherwise "A" - * means sort ascending and "D" means sort descending. </li> - * <li>CARDINALITY - int - Number of unique values in the Index. If TYPE is - * tableIndexStatistic, this is number of rows in the table.</li> - * <li>PAGES - int - Number of pages for current Index. If TYPE is + * means sort ascending and "D" means sort descending.</li> + * <li>{@code CARDINALITY} - int - Number of unique values in the Index. If + * TYPE is tableIndexStatistic, this is number of rows in the table.</li> + * <li>{@code PAGES} - int - Number of pages for current Index. If TYPE is * tableIndexStatistic, this is number of pages used for the table.</li> - * <li>FILTER_CONDITION - String - Filter condition. (possibly null) </li> + * <li>{@code FILTER_CONDITION} - String - Filter condition. (possibly null) + * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name. null is used to imply no narrowing of the - * search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with "" used to retrieve those + * without a schema name. * @param table * a table name, which must match the name of a table in the - * database + * database. * @param unique - * <code>true</code> means only return indices for unique - * values, <code>false</code> implies that they can be returned - * even if not unique. + * {@code true} means only return indices for unique values, + * {@code false} implies that they can be returned even if not + * unique. * @param approximate - * <code>true</code> implies that the list can contain - * approximate or "out of data" values, <code>false</code> - * implies that all values must be precisely accurate - * @return a ResultSet containing the list of indices and statistics for the - * table, in the format defined above. + * {@code true} implies that the list can contain approximate or + * "out of data" values, {@code false} implies that all values + * must be precisely accurate + * @return a {@code ResultSet} containing the list of indices and statistics + * for the table, in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException; @@ -1140,18 +1270,20 @@ public interface DatabaseMetaData { /** * Returns this driver's major JDBC version number. * - * @return the major JDBC version number + * @return the major JDBC version number. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getJDBCMajorVersion() throws SQLException; /** * Returns the minor JDBC version number for this driver. * - * @return the Minor JDBC Version Number + * @return the Minor JDBC Version Number. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getJDBCMinorVersion() throws SQLException; @@ -1162,17 +1294,19 @@ public interface DatabaseMetaData { * @return the maximum number of hex characters in an in-line binary * literal. If the number is unlimited then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxBinaryLiteralLength() throws SQLException; /** - * Returns the maximum size of a Catalog name in this database. + * Returns the maximum size of a catalog name in this database. * - * @return the maximum size in characters for a Catalog name. If the limit + * @return the maximum size in characters for a catalog name. If the limit * is unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxCatalogNameLength() throws SQLException; @@ -1183,7 +1317,8 @@ public interface DatabaseMetaData { * limit is unknown, or the value is unlimited, then the result is * zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxCharLiteralLength() throws SQLException; @@ -1193,17 +1328,21 @@ public interface DatabaseMetaData { * @return the maximum number of characters for a Column name. If the limit * is unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnNameLength() throws SQLException; /** - * Get the maximum number of columns in a GROUP BY clause for this database. + * Get the maximum number of columns in a {@code GROUP BY} clause for this + * database. * - * @return the maximum number of columns in a GROUP BY clause. If the limit - * is unknown, or the value is unlimited, then the result is zero. + * @return the maximum number of columns in a {@code GROUP BY} clause. If + * the limit is unknown, or the value is unlimited, then the result + * is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnsInGroupBy() throws SQLException; @@ -1213,28 +1352,34 @@ public interface DatabaseMetaData { * @return the maximum number of columns in an Index. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnsInIndex() throws SQLException; /** - * Returns the maximum number of columns in an ORDER BY clause for this - * database. + * Returns the maximum number of columns in an {@code ORDER BY} clause for + * this database. * - * @return the maximum number of columns in an ORDER BY clause. If the limit - * is unknown, or the value is unlimited, then the result is zero. + * @return the maximum number of columns in an {@code ORDER BY} clause. If + * the limit is unknown, or the value is unlimited, then the result + * is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnsInOrderBy() throws SQLException; /** - * Returns the maximum number of columns in a SELECT list for this database. + * Returns the maximum number of columns in a {@code SELECT} list for this + * database. * - * @return the maximum number of columns in a SELECT list. If the limit is - * unknown, or the value is unlimited, then the result is zero. + * @return the maximum number of columns in a {@code SELECT} list. If the + * limit is unknown, or the value is unlimited, then the result is + * zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnsInSelect() throws SQLException; @@ -1244,7 +1389,8 @@ public interface DatabaseMetaData { * @return the maximum number of columns in a table. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxColumnsInTable() throws SQLException; @@ -1254,7 +1400,8 @@ public interface DatabaseMetaData { * @return the maximum number of connections. If the limit is unknown, or * the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxConnections() throws SQLException; @@ -1264,7 +1411,8 @@ public interface DatabaseMetaData { * @return the maximum number of characters in a cursor name. If the limit * is unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxCursorNameLength() throws SQLException; @@ -1275,7 +1423,8 @@ public interface DatabaseMetaData { * @return the maximum length in bytes for an Index. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxIndexLength() throws SQLException; @@ -1287,7 +1436,8 @@ public interface DatabaseMetaData { * limit is unknown, or the value is unlimited, then the result is * zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxProcedureNameLength() throws SQLException; @@ -1298,7 +1448,8 @@ public interface DatabaseMetaData { * @return the maximum number of bytes for a single row. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxRowSize() throws SQLException; @@ -1306,10 +1457,11 @@ public interface DatabaseMetaData { * Returns the maximum number of characters in a schema name for this * database. * - * @return the maximum number of characters in a Schema name. If the limit + * @return the maximum number of characters in a schema name. If the limit * is unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxSchemaNameLength() throws SQLException; @@ -1321,7 +1473,8 @@ public interface DatabaseMetaData { * limit is unknown, or the value is unlimited, then the result is * zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxStatementLength() throws SQLException; @@ -1332,7 +1485,8 @@ public interface DatabaseMetaData { * @return the maximum number of open active statements. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxStatements() throws SQLException; @@ -1342,19 +1496,21 @@ public interface DatabaseMetaData { * @return the maximum size in characters for a table name. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxTableNameLength() throws SQLException; /** - * Returns the maximum number of tables permitted in a SELECT statement for - * the database. + * Returns the maximum number of tables permitted in a {@code SELECT} + * statement for the database. * - * @return the maximum number of tables permitted in a SELECT statement. If - * the limit is unknown, or the value is unlimited, then the result - * is zero. + * @return the maximum number of tables permitted in a {@code SELECT} + * statement. If the limit is unknown, or the value is unlimited, + * then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxTablesInSelect() throws SQLException; @@ -1364,7 +1520,8 @@ public interface DatabaseMetaData { * @return the maximum number of characters in a user name. If the limit is * unknown, or the value is unlimited, then the result is zero. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getMaxUserNameLength() throws SQLException; @@ -1373,122 +1530,129 @@ public interface DatabaseMetaData { * are used in the JDBC function escape clause and are the Open Group CLI * math function names. * - * @return a String which contains the list of Math functions as a comma + * @return a String which contains the list of math functions as a comma * separated list. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getNumericFunctions() throws SQLException; /** * Returns a list of the primary key columns of a specified table. * <p> - * The list is returned as a ResultSet with one row for each primary key - * column, ordered by <code>COLUMN_NAME</code>, with each row having the + * The list is returned as a {@code ResultSet} with one row for each primary + * key column, ordered by {@code COLUMN_NAME}, with each row having the * structure as follows: * <ol> - * <li><code>TABLE_CAT</code> - String - table catalog name (possibly - * null)</li> - * <li><code>TABLE_SCHEM</code> - String - Table Schema name (possibly - * null) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>COLUMN_NAME</code> - String - The Column name </li> - * <li><code>KEY_SEQ</code> - short - the sequence number for this column - * in the primary key</li> - * <li><code>PK_NAME</code> - String - the primary key name (possibly - * null)</li> + * <li>{@code TABLE_CAT} - String - table catalog name (possibly null)</li> + * <li>{@code TABLE_SCHEM} - String - table schema name (possibly null)</li> + * <li>{@code TABLE_NAME} - String - The table name</li> + * <li>{@code COLUMN_NAME} - String - The column name</li> + * <li>{@code KEY_SEQ} - short - the sequence number for this column in the + * primary key</li> + * <li>{@code PK_NAME} - String - the primary key name (possibly null)</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with the - * empty string used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with the empty string used + * to retrieve those without a catalog name. * @param schema - * a Schema Name. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with the empty - * string used to retrieve those without a Schema name. + * a schema name. {@code null} is used to imply no narrowing of + * the search by schema name. Otherwise, the name must match a + * schema name in the database, with the empty string used to + * retrieve those without a schema name. * @param table * the name of a table, which must match the name of a table in - * the database - * @return a ResultSet containing the list of keys in the format defined - * above + * the database. + * @return a {@code ResultSet} containing the list of keys in the format + * defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException; /** * Returns a list of parameter and result columns for the stored procedures - * belonging to a specified Catalog. + * belonging to a specified catalog. * <p> - * The list is returned as a ResultSet with one row for each parameter or - * result column. The data is ordered by PROCEDURE_SCHEM and PROCEDURE_NAME, - * while for each procedure, the return value (if any) is first, followed by - * the parameters in the order they appear in the stored procedure call, - * followed by ResultSet columns in column number order. Each row has the - * following structure: + * The list is returned as a {@code ResultSet} with one row for each + * parameter or result column. The data is ordered by {@code + * PROCEDURE_SCHEM} and {@code PROCEDURE_NAME}, while for each procedure, + * the return value (if any) is first, followed by the parameters in the + * order they appear in the stored procedure call, followed by {@code + * ResultSet} columns in column number order. Each row has the following + * structure: * <ol> - * <li>PROCEDURE_CAT - String - the procedure catalog name</li> - * <li>PROCEDURE_SCHEM - String - the procedure schema name (possibly null) - * </li> - * <li>PROCEDURE_NAME - String - the procedure name</li> - * <li><code>COLUMN_NAME</code> - String - the name of the column</li> - * <li>COLUMN_TYPE - short - the kind of column or parameter, as follows: + * <li>{@code PROCEDURE_CAT} - String - the procedure catalog name</li> + * <li>{@code PROCEDURE_SCHEM} - String - the procedure schema name + * (possibly null)</li> + * <li>{@code PROCEDURE_NAME} - String - the procedure name</li> + * <li>{@code COLUMN_NAME} - String - the name of the column</li> + * <li>{@code COLUMN_TYPE} - short - the kind of column or parameter, as + * follows: * <ul> - * <li>DatabaseMetaData.procedureColumnUnknown - type unknown</li> - * <li>DatabaseMetaData.procedureColumnIn - an IN parameter</li> - * <li>DatabaseMetaData.procedureColumnInOut - an INOUT parameter</li> - * <li>DatabaseMetaData.procedureColumnOut - an OUT parameter</li> - * <li>DatabaseMetaData.procedureColumnReturn - a return value</li> - * <li>DatabaseMetaData.procedureReturnsResult - a result column in a - * result set</li> + * <li>{@code DatabaseMetaData.procedureColumnUnknown} - type unknown</li> + * <li>{@code DatabaseMetaData.procedureColumnIn} - an {@code IN} parameter</li> + * <li>{@code DatabaseMetaData.procedureColumnInOut} - an {@code INOUT} + * parameter</li> + * <li>{@code DatabaseMetaData.procedureColumnOut} - an {@code OUT} + * parameter</li> + * <li>{@code DatabaseMetaData.procedureColumnReturn} - a return value</li> + * <li>{@code DatabaseMetaData.procedureReturnsResult} - a result column in + * a result set</li> * </ul> * </li> - * <li><code>DATA_TYPE</code> - int - the SQL type of the data, as in - * <code>java.sql.Types</code> </li> - * <li><code>TYPE_NAME</code> - String - the SQL type name, for a UDT it - * is fully qualified</li> - * <li>PRECISION - int - the precision</li> - * <li>LENGTH - int - the length of the data in bytes </li> - * <li>SCALE - short - the scale for numeric types</li> - * <li>RADIX - short - the Radix for numeric data (typically 2 or 10) </li> - * <li>NULLABLE - short - can the data contain null: + * <li>{@code DATA_TYPE} - int - the SQL type of the data, as in {@code + * java.sql.Types}</li> + * <li>{@code TYPE_NAME} - String - the SQL type name, for a UDT it is fully + * qualified</li> + * <li>{@code PRECISION} - int - the precision</li> + * <li>{@code LENGTH} - int - the length of the data in bytes</li> + * <li>{@code SCALE} - short - the scale for numeric types</li> + * <li>{@code RADIX} - short - the Radix for numeric data (typically 2 or + * 10)</li> + * <li>{@code NULLABLE} - short - can the data contain {@code null}: * <ul> - * <li>DatabaseMetaData.procedureNoNulls - <code>NULL</code>s not + * <li>{@code DatabaseMetaData.procedureNoNulls} - {@code NULL}s not + * permitted</li> + * <li>{@code DatabaseMetaData.procedureNullable} - {@code NULL}s are * permitted</li> - * <li>DatabaseMetaData.procedureNullable - <code>NULL</code>s are - * permitted </li> - * <li>DatabaseMetaData.procedureNullableUnknown - <code>NULL</code> - * status unknown </li> + * <li>{@code DatabaseMetaData.procedureNullableUnknown} - {@code NULL} + * status unknown</li> * </ul> * </li> - * <li><code>REMARKS</code> - String - an explanatory comment about the - * data item </li> + * <li>{@code REMARKS} - String - an explanatory comment about the data item + * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. null is used to imply no narrowing of - * the search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param procedureNamePattern * a pattern that must match the name of the procedure stored in - * the database + * the database. * @param columnNamePattern * a column name pattern. The name must match the column name * stored in the database. - * @return a ResultSet with the list of parameter and result columns in the - * format defined above + * @return a {@code ResultSet} with the list of parameter and result columns + * in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) @@ -1497,47 +1661,48 @@ public interface DatabaseMetaData { /** * Returns a list of the stored procedures available in a specified catalog. * <p> - * The list is returned as a ResultSet with one row for each stored - * procedure, ordered by PROCEDURE_SCHEME and PROCEDURE_NAME, with the data + * The list is returned as a {@code ResultSet} with one row for each stored + * procedure, ordered by PROCEDURE_SCHEM and PROCEDURE_NAME, with the data * in each row as follows: * <ol> - * <li><code>PROCEDURE_CAT</code> - String : the procedure catalog name</li> - * <li><code>PROCEDURE_SCHEM</code> - String : the procedure schema name - * (possibly <code>null</code>) </li> - * <li><code>PROCEDURE_NAME</code> - String : the procedure name</li> - * <li><code>Reserved</code></li> - * <li><code>Reserved</code></li> - * <li><code>Reserved</code></li> - * <li><code>REMARKS</code> - String - information about the procedure</li> - * <li><code>PROCEDURE_TYPE</code> - short : one of: + * <li>{@code PROCEDURE_CAT} - String : the procedure catalog name</li> + * <li>{@code PROCEDURE_SCHEM} - String : the procedure schema name + * (possibly {@code null})</li> + * <li>{@code PROCEDURE_NAME} - String : the procedure name</li> + * <li>{@code Reserved}</li> + * <li>{@code Reserved}</li> + * <li>{@code Reserved}</li> + * <li>{@code REMARKS} - String - information about the procedure</li> + * <li>{@code PROCEDURE_TYPE} - short : one of: * <ul> - * <li>DatabaseMetaData.procedureResultUnknown - procedure may return a - * result </li> - * <li>DatabaseMetaData.procedureNoResult - procedure does not return a - * result</li> - * <li>DatabaseMetaData.procedureReturnsResult - procedure definitely - * returns a result</li> + * <li>{@code DatabaseMetaData.procedureResultUnknown} - procedure may + * return a result</li> + * <li>{@code DatabaseMetaData.procedureNoResult} - procedure does not + * return a result</li> + * <li>{@code DatabaseMetaData.procedureReturnsResult} - procedure + * definitely returns a result</li> * </ul> * </li> * </ol> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. null is used to imply no narrowing of - * the search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param procedureNamePattern * a procedure name pattern, which must match the procedure name - * stored in the database - * @return a ResultSet where each row is a description of a stored procedure - * in the format defined above. + * stored in the database. + * @return a {@code ResultSet} where each row is a description of a stored + * procedure in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException; @@ -1545,58 +1710,62 @@ public interface DatabaseMetaData { /** * Returns the database vendor's preferred name for "procedure". * - * @return a String with the vendor's preferred name for "procedure" + * @return a String with the vendor's preferred name for "procedure". * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getProcedureTerm() throws SQLException; /** - * Returns the result set's default hold-ability. + * Returns the result set's default holdability. * - * @return one of <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or - * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code> + * @return one of {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code + * ResultSet.CLOSE_CURSORS_AT_COMMIT}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getResultSetHoldability() throws SQLException; /** * Returns a list of the schema names in the database. The list is returned - * as a ResultSet, ordered by the Schema name, with one row per Schema in - * the following format: + * as a {@code ResultSet}, ordered by the schema name, with one row per + * schema in the following format: * <ol> - * <li><code>TABLE_SCHEM</code> - String - the Schema name</li> - * <li><code>TABLE_CAT</code>ALOG - String - the Catalog name (possibly - * null) </li> + * <li>{@code TABLE_SCHEM} - String - the schema name</li> <li>{@code + * TABLE_CATALOG} - String - the catalog name (possibly {@code null}) </li> * </ol> * - * @return a ResultSet with one row for each schema in the format defined - * above. + * @return a {@code ResultSet} with one row for each schema in the format + * defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getSchemas() throws SQLException; /** * Returns the database vendor's preferred term for "schema". * - * @return a String which is the vendor's preferred term for schema + * @return a String which is the vendor's preferred term for schema. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getSchemaTerm() throws SQLException; /** * Returns the string that is used to escape wildcard characters. This - * string is used to escape the '_' and '%' wildcard characters in catalog - * search strings which are a pattern and so which use the wildcard - * characters. '_' is used to represent any single character wile '%' is - * used for a sequence of zero or more characters. + * string is used to escape the {@code '_'} and {@code '%'} wildcard + * characters in catalog search pattern strings. {@code '_'} is used to represent any single + * character while {@code '%'} is used for a sequence of zero or more + * characters. * - * @return a String used to escape the wildcard characters + * @return a String used to escape the wildcard characters. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getSearchStringEscape() throws SQLException; @@ -1607,19 +1776,22 @@ public interface DatabaseMetaData { * @return a String containing the list of SQL keywords in a comma separated * format. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getSQLKeywords() throws SQLException; /** - * States the type of SQLState value returned by SQLException.getSQLState. - * This can either be the X/Open (now known as Open Group) SQL CLI form or - * the SQL99 form. + * States the type of {@code SQLState} value returned by {@code + * SQLException.getSQLState}. This can either be the X/Open (now known as + * Open Group) SQL CLI form or the SQL99 form. * - * @return an integer, which is either DatabaseMetaData.sqlStateSQL99 or - * DatabaseMetaData.sqlStateXOpen. + * @return an integer, which is either {@code + * DatabaseMetaData.sqlStateSQL99} or {@code + * DatabaseMetaData.sqlStateXOpen}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public int getSQLStateType() throws SQLException; @@ -1631,7 +1803,8 @@ public interface DatabaseMetaData { * @return a String containing the list of string functions in comma * separated format. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getStringFunctions() throws SQLException; @@ -1640,39 +1813,40 @@ public interface DatabaseMetaData { * the database. * <p> * The listing only contains entries for tables that have a super table. - * Super and sub tables must be defined in the same Catalog and Schema. The - * list is returned as a ResultSet, with one row for each table that has a - * super table, in the following format: + * Super tables and corresponding subtables must be defined in the same catalog and schema. The + * list is returned as a {@code ResultSet}, with one row for each table that + * has a super table, in the following format: * <ol> - * <li><code>TABLE_CAT</code> - String - table catalog name (possibly - * null)</li> - * <li><code>TABLE_SCHEM</code> - String - Table Schema name (possibly - * null) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li>SUPER<code>TABLE_NAME</code> - String - The Super Table name - * </li> + * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code + * null})</li> + * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code + * null})</li> + * <li>{@code TABLE_NAME} - String - The table name</li> + * <li>SUPER{@code TABLE_NAME} - String - The super table name</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. null is used to imply no narrowing of - * the search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param tableNamePattern - * a Table Name, which should match the Table name as stored in + * a table name, which should match the table name as stored in * the database. it may be a fully qualified name. If it is fully - * qualified the Catalog Name and Schema Name parameters are + * qualified the catalog name and schema name parameters are * ignored. - * @return a ResultSet with one row for each table which has a super table, - * in the format defined above. An empty ResultSet is returned if - * the database does not support table hierarchies. + * @return a {@code ResultSet} with one row for each table which has a super + * table, in the format defined above. An empty {@code ResultSet} is + * returned if the database does not support table hierarchies. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException; @@ -1682,38 +1856,40 @@ public interface DatabaseMetaData { * the immediate parent/child relationship is described. If a UDT does not * have a direct supertype, it is not listed. * <p> - * The listing is returned as a ResultSet where there is one row for a - * specific UDT which describes its supertype, with the data organized in + * The listing is returned as a {@code ResultSet} where there is one row for + * a specific UDT which describes its supertype, with the data organized in * columns as follows: * <ol> - * <li><code>TYPE_CAT</code> - String - the UDT Catalog name (possibly - * null)</li> - * <li><code>TYPE_SCHEM</code> - String - the UDT Schema name (possibly - * null) </li> - * <li><code>TYPE_NAME</code> - String - the UDT type name </li> - * <li>SUPER<code>TYPE_CAT</code> - String - direct supertype's Catalog - * name (possibly null)</li> - * <li>SUPER<code>TYPE_SCHEM</code> - String - direct supertype's Schema - * name (possibly null) </li> - * <li>SUPER<code>TYPE_NAME</code> - String - direct supertype's name - * </li> + * <li>{@code TYPE_CAT} - String - the UDT catalog name (possibly {@code + * null})</li> + * <li>{@code TYPE_SCHEM} - String - the UDT schema name (possibly {@code + * null})</li> + * <li>{@code TYPE_NAME} - String - the UDT type name</li> + * <li>SUPER{@code TYPE_CAT} - String - direct supertype's catalog name + * (possibly {@code null})</li> + * <li>SUPER{@code TYPE_SCHEM} - String - direct supertype's schema name + * (possibly {@code null})</li> + * <li>SUPER{@code TYPE_NAME} - String - direct supertype's name</li> * </ol> + * </p> * * @param catalog - * the Catalog name. "" means get the UDTs without a catalog. - * null means don't use the catalog name to restrict the search. + * the catalog name. "" means get the UDTs without a catalog. + * {@code null} means don't use the catalog name to restrict the + * search. * @param schemaPattern * the Schema pattern name. "" means get the UDT's without a * schema. * @param typeNamePattern * the UDT name pattern. This may be a fully qualified name. When - * a fully qualified name is specified, the Catalog name and - * Schema name parameters are ignored. - * @return a ResultSet in which each row gives information about a + * a fully qualified name is specified, the catalog name and + * schema name parameters are ignored. + * @return a {@code ResultSet} in which each row gives information about a * particular UDT in the format defined above. An empty ResultSet is * returned for a database that does not support type hierarchies. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException; @@ -1724,9 +1900,10 @@ public interface DatabaseMetaData { * function names. * * @return a String containing the list of system functions in a comma - * separated format + * separated format. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getSystemFunctions() throws SQLException; @@ -1735,42 +1912,44 @@ public interface DatabaseMetaData { * catalog. Table privileges can apply to one or more columns in the table - * but are not guaranteed to apply to all columns. * <p> - * The privileges are returned as a ResultSet, with one row for each - * privilege, ordered by <code>TABLE_SCHEM</code>, - * <code>TABLE_NAME</code>, PRIVILEGE, and each row has data as defined - * in the following column definitions: + * The privileges are returned as a {@code ResultSet}, with one row for each + * privilege, ordered by {@code TABLE_SCHEM}, {@code TABLE_NAME}, {@code + * PRIVILEGE}, and each row has data as defined in the following column + * definitions: * <ol> - * <li><code>TABLE_CAT</code> - String - table catalog name (possibly - * null)</li> - * <li><code>TABLE_SCHEM</code> - String - Table Schema name (possibly - * null) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> + * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code + * null})</li> + * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code + * null})</li> + * <li>{@code TABLE_NAME} - String - The table name</li> * <li>GRANTOR - String - who granted the access</li> - * <li>GRANTEE - String - who received the access grant </li> + * <li>GRANTEE - String - who received the access grant</li> * <li>PRIVILEGE - String - the type of access granted - one of SELECT, - * INSERT, UPDATE, REFERENCES,... </li> - * <li>IS_GRANTABLE - String - "YES" implies the grantee can grant access - * to others, "NO" implies guarantee cannot grant access to others, null - * means this status is unknown</li> + * INSERT, UPDATE, REFERENCES,...</li> + * <li>IS_GRANTABLE - String - {@code "YES"} implies the grantee can grant + * access to others, {@code "NO"} implies guarantee cannot grant access to + * others, {@code null} means this status is unknown</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. null is used to imply no narrowing of - * the search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param tableNamePattern - * a Table Name, which should match the Table name as stored in + * a Table Name, which should match the table name as stored in * the database. - * @return a ResultSet containing a list with one row for each table in the - * format defined above. + * @return a {@code ResultSet} containing a list with one row for each table + * in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException; @@ -1778,53 +1957,54 @@ public interface DatabaseMetaData { /** * Returns a description of the tables in a specified catalog. * <p> - * The descriptions are returned as rows in a ResultSet, one row for each - * Table. The ResultSet is ordered by <code>TABLE_TYPE</code>, - * <code>TABLE_SCHEM</code> and <code>TABLE_NAME</code>. Each row in - * the ResultSet consists of a series of columns as follows: + * The descriptions are returned as rows in a {@code ResultSet}, one row for + * each Table. The ResultSet is ordered by {@code TABLE_TYPE}, {@code + * TABLE_SCHEM} and {@code TABLE_NAME}. Each row in the ResultSet consists + * of a series of columns as follows: * <ol> - * <li><code>TABLE_CAT</code> - String - table catalog name (possibly - * null)</li> - * <li><code>TABLE_SCHEM</code> - String - Table Schema name (possibly - * null) </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>TABLE_TYPE</code> - String - Typical names include "TABLE", - * "VIEW", "SYSTEM TABLE", "ALIAS", "SYNONYM", "GLOBAL TEMPORARY"</li> - * <li><code>REMARKS</code> - String - A comment describing the table + * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code + * null})</li> + * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code + * null})</li> + * <li>{@code TABLE_NAME} - String - The table name</li> + * <li>{@code TABLE_TYPE} - String - Typical names include "TABLE", "VIEW", + * "SYSTEM TABLE", "ALIAS", "SYNONYM", "GLOBAL TEMPORARY"</li> + * <li>{@code REMARKS} - String - A comment describing the table</li> + * <li>{@code TYPE_CAT} - String - the 'Types' catalog(possibly {@code null} + * )</li> + * <li>{@code TYPE_SCHEM} - String - the 'Types' schema(possibly {@code + * null})</li> + * <li>{@code TYPE_NAME} - String - the 'Types' name (possibly {@code null}) * </li> - * <li><code>TYPE_CAT</code> - String - the 'Types' catalog(possibly - * null)</li> - * <li><code>TYPE_SCHEM</code> - String - the 'Types' schema(possibly - * null) </li> - * <li><code>TYPE_NAME</code> - String - the 'Types' name (possibly null) - * </li> - * <li><code>SELF_REFERENCING_COL_NAME</code> - String - the name of a - * designated identifier column in a typed table (possibly null) </li> + * <li>{@code SELF_REFERENCING_COL_NAME} - String - the name of a designated + * identifier column in a typed table (possibly {@code null})</li> * <li>REF_GENERATION - String - one of the following values : "SYSTEM" | - * "USER" | "DERIVED" - specifies how values in the - * <code>SELF_REFERENCING_COL_NAME</code> are created (possibly null) - * </li> + * "USER" | "DERIVED" - specifies how values in the {@code + * SELF_REFERENCING_COL_NAME} are created (possibly {@code null})</li> * </ol> + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. null is used to imply no narrowing of - * the search using Schema Name. Otherwise, the name must match a - * Schema name in the database, with "" used to retrieve those - * without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search by schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param tableNamePattern - * a Table Name, which should match the Table name as stored in + * a table name, which should match the table name as stored in * the database. * @param types - * a list of table types to include in the list. null implies - * list all types. - * @return a ResultSet with one row per table in the format defined above. + * a list of table types to include in the list. {@code null} + * implies list all types. + * @return a {@code ResultSet} with one row per table in the format defined + * above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException; @@ -1832,131 +2012,141 @@ public interface DatabaseMetaData { /** * Returns a list of table types supported by the database. * <p> - * The list is returned as a ResultSet with one row per table type, ordered - * by the table type. The information in the ResultSet is structured into a - * single column per row, as follows: + * The list is returned as a {@code ResultSet} with one row per table type, + * ordered by the table type. The information in the {@code ResultSet} is + * structured into a single column per row, as follows: * <ol> - * <li><code>TABLE_TYPE</code> - String - the Table Type. Typical names - * include "TABLE", "VIEW", "SYSTEM TABLE", "ALIAS", "SYNONYM", "GLOBAL - * TEMPORARY" </li> + * <li>{@code TABLE_TYPE} - String - the table type. Typical names include + * {@code "TABLE"}, {@code "VIEW"}, "{@code SYSTEM TABLE"}, {@code "ALIAS"}, + * {@code "SYNONYM"}, {@code "GLOBAL TEMPORARY"}</li> * </ol> + * </p> * - * @return a ResultSet with one row per table type in the format defined - * above. + * @return a {@code ResultSet} with one row per table type in the format + * defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getTableTypes() throws SQLException; /** * Returns a list of time and date functions available for the database. * - * @return a String contain a comma separated list of the time and date + * @return a string containing a comma separated list of the time and date * functions. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getTimeDateFunctions() throws SQLException; /** - * Get a list of the standard SQL Types supported by this database. The list - * is returned as a ResultSet, with one row for each type, ordered by the - * <code>DATA_TYPE</code> value, where the data in each row is structured + * Get a list of the standard SQL types supported by this database. The list + * is returned as a {@code ResultSet}, with one row for each type, ordered + * by the {@code DATA_TYPE} value, where the data in each row is structured * into the following columns: * <ol> - * <li><code>TYPE_NAMR</code> - String : the Type name</li> - * <li><code>DATA_TYPE</code> - int : the SQL data type value as defined - * in <code>java.sql.Types</code></li> - * <li><code>PRECISION</code> - int - the maximum precision of the type</li> - * <li><code>LITERAL_PREFIX</code> - String : the prefix to be used when - * quoting a literal value (possibly <code>null</code>)</li> - * <li><code>LITERAL_SUFFIX</code> - String : the suffix to be used when - * quoting a literal value (possibly <code>null</code>)</li> - * <li><code>CREATE_PARAMS</code> - String : params used when creating - * the type (possibly <code>null</code>)</li> - * <li><code>NULLABLE</code> - short : shows if the value is null-able: + * <li>{@code TYPE_NAME} - String : the type name</li> + * <li>{@code DATA_TYPE} - int : the SQL data type value as defined in + * {@code java.sql.Types}</li> + * <li>{@code PRECISION} - int - the maximum precision of the type</li> + * <li>{@code LITERAL_PREFIX} - String : the prefix to be used when quoting + * a literal value (possibly {@code null})</li> + * <li>{@code LITERAL_SUFFIX} - String : the suffix to be used when quoting + * a literal value (possibly {@code null})</li> + * <li>{@code CREATE_PARAMS} - String : params used when creating the type + * (possibly {@code null})</li> + * <li>{@code NULLABLE} - short : shows if the value is nullable: * <ul> - * <li>DatabaseMetaData.typeNoNulls : <code>NULL</code>s not permitted</li> - * <li>DatabaseMetaData.typeNullable : <code>NULL</code>s are permitted - * </li> - * <li>DatabaseMetaData.typeNullableUnknown : <code>NULL</code> status - * unknown </li> + * <li>{@code DatabaseMetaData.typeNoNulls} : {@code NULL}s not permitted</li> + * <li>{@code DatabaseMetaData.typeNullable} : {@code NULL}s are permitted</li> + * <li>{@code DatabaseMetaData.typeNullableUnknown} : {@code NULL} status + * unknown</li> * </ul> * </li> - * <li>CASE_SENSITIVE - boolean : true if the type is case sensitive</li> - * <li>SEARCHABLE - short : how this type can be used with WHERE clauses: + * <li>{@code CASE_SENSITIVE} - boolean : true if the type is case sensitive + * </li> + * <li>{@code SEARCHABLE} - short : how this type can be used with {@code WHERE} + * clauses: * <ul> - * <li>DatabaseMetaData.typePredNone - cannot be used </li> - * <li>DatabaseMetaData.typePredChar - support for WHERE...LIKE only</li> - * <li>DatabaseMetaData.typePredBasic - support except for WHERE...LIKE</li> - * <li>DatabaseMetaData.typeSearchable - support for all WHERE clauses</li> + * <li>{@code DatabaseMetaData.typePredNone} - {@code WHERE} clauses cannot be used</li> + * <li>{@code DatabaseMetaData.typePredChar} - support for {@code + * WHERE...LIKE} only</li> + * <li>{@code DatabaseMetaData.typePredBasic} - support except for {@code + * WHERE...LIKE}</li> + * <li>{@code DatabaseMetaData.typeSearchable} - support for all {@code + * WHERE} clauses</li> * </ul> * </li> - * <li>UNSIGNED_ATTRIBUTE - boolean - the type is unsigned or not </li> - * <li>FIXED_PREC_SCALE - boolean - fixed precision = it can be used as a - * money value </li> - * <li>AUTO_INCREMENT - boolean - can be used as an auto-increment value - * </li> - * <li>LOCAL_<code>TYPE_NAME</code> - String - a localized version of - * the type name (possibly null)</li> - * <li>MINIMUM_SCALE - short - the minimum scale supported </li> - * <li>MAXIMUM_SCALE - short - the maximum scale supported </li> - * <li>SQL_<code>DATA_TYPE</code> - int - not used </li> - * <li>SQL_DATETIME_SUB - int - not used </li> - * <li>NUM_PREC_RADIX - int - number radix (typically 2 or 10) </li> + * <li>{@code UNSIGNED_ATTRIBUTE} - boolean - the type is unsigned or not</li> + * <li>{@code FIXED_PREC_SCALE} - boolean - fixed precision = it can be used + * as a money value</li> + * <li>{@code AUTO_INCREMENT} - boolean - can be used as an auto-increment + * value</li> + * <li>{@code LOCAL_TYPE_NAME} - String - a localized version of the type + * name (possibly {@code null})</li> + * <li>{@code MINIMUM_SCALE} - short - the minimum scale supported</li> + * <li>{@code MAXIMUM_SCALE} - short - the maximum scale supported</li> + * <li>{@code SQL_DATA_TYPE} - int - not used</li> + * <li>{@code SQL_DATETIME_SUB} - int - not used</li> + * <li>{@code NUM_PREC_RADIX} - int - number radix (typically 2 or 10)</li> * </ol> * - * @return a ResultSet which is structured as described above + * @return a {@code ResultSet} which is structured as described above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getTypeInfo() throws SQLException; /** * Returns a description of the User Defined Types (UDTs) defined in a given - * schema, which includes the types DISTINCT, STRUCT and JAVA_OBJECT. + * schema, which includes the types {@code DISTINCT}, {@code STRUCT} and + * {@code JAVA_OBJECT}. * <p> - * The types matching the supplied the specified Catalog, Schema, Type Name - * and Type are returned as rows in a ResultSet with columns of information - * as follows: + * The types matching the supplied the specified catalog, schema, type name + * and type are returned as rows in a {@code ResultSet} with columns of + * information as follows: * <ol> - * <li><code>TABLE_CAT</code> - String - Catalog name (possibly null)</li> - * <li><code>TABLE_SCHEM</code> - String - Schema name (possibly null) - * </li> - * <li><code>TABLE_NAME</code> - String - The Table name </li> - * <li><code>CLASS_NAME</code> - String - The Java class name</li> - * <li><code>DATA_TYPE</code> - int - The SQL type as specified in - * <code>java.sql.Types</code>. One of DISTINCT, STRUCT and JAVA_OBJECT</li> - * <li><code>REMARKS</code> - String - A comment which describes the type - * </li> - * <li><code>BASE_TYPE</code> - short - A type code. For a DISTINCT type, - * the source type. For a structured type this is the type that implements - * the user generated reference type of the - * <code>SELF_REFERENCING_COLUMN</code>. This is defined in - * <code>java.sql.Types</code>, and will be <code>null</code> if the - * <code>DATA_TYPE</code> does not match these criteria.</li> + * <li>{@code TABLE_CAT} - String - catalog name (possibly {@code null})</li> + * <li>{@code TABLE_SCHEM} - String - schema name (possibly {@code null})</li> + * <li>{@code TABLE_NAME} - String - The table name</li> + * <li>{@code CLASS_NAME} - String - The Java class name</li> + * <li>{@code DATA_TYPE} - int - The SQL type as specified in {@code + * java.sql.Types}. One of DISTINCT, STRUCT, and JAVA_OBJECT</li> + * <li>{@code REMARKS} - String - A comment which describes the type</li> + * <li>{@code BASE_TYPE} - short - A type code. For a DISTINCT type, the + * source type. For a structured type this is the type that implements the + * user generated reference type of the {@code SELF_REFERENCING_COLUMN}. + * This is defined in {@code java.sql.Types}, and will be {@code null} if + * the {@code DATA_TYPE} does not match these criteria.</li> * </ol> - * If the driver does not support UDTs, the ResultSet will be empty. + * </p> + * <p> + * If the driver does not support UDTs, the {@code ResultSet} is empty. + * </p> * * @param catalog - * a Catalog Name. null is used to imply no narrowing of the - * search using Catalog Name. Otherwise, the name must match a - * Catalog Name held in the database, with "" used to retrieve - * those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search by catalog name. Otherwise, the name must match a + * catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schemaPattern - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search using schema name. Otherwise, the name + * must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param typeNamePattern - * a Type Name, which should match a Type name as stored in the + * a type name pattern, which should match a type name as stored in the * database. It may be fully qualified. * @param types * a list of the UDT types to include in the list - one of - * DISTINCT, STRUCT or JAVA_OBJECT. - * @return a ResultSet in the format described above + * {@code DISTINCT}, {@code STRUCT} or {@code JAVA_OBJECT}. + * @return a {@code ResultSet} in the format described above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException; @@ -1964,19 +2154,20 @@ public interface DatabaseMetaData { /** * Returns the URL for this database. * - * @return the URL for the database. <code>null</code> if it cannot be - * generated. + * @return the URL for the database. {@code null} if it cannot be generated. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getURL() throws SQLException; /** * Determine the user name as known by the database. * - * @return the user name + * @return the user name. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public String getUserName() throws SQLException; @@ -1986,62 +2177,65 @@ public interface DatabaseMetaData { * <p> * The result is laid-out in the following columns: * <ol> - * <li><code>SCOPE</code> - short - not used </li> - * <li><code>COLUMN_NAME</code> - String - Column name</li> - * <li><code>DATA_TYPE</code> - int - The SQL data type, as defined in - * <code>java.sql.Types</code> </li> - * <li><code>TYPE_NAME</code> - String - The SQL type name, data source - * dependent </li> - * <li><code>COLUMN_SIZE</code> - int - Precision for numeric types </li> - * <li><code>BUFFER_LENGTH</code> - int - Length of a column value in - * bytes </li> - * <li><code>DECIMAL_DIGITS</code> - short - Number of digits after the - * decimal point </li> - * <li><code>PSEUDO_COLUMN</code> - short - If this is a pseudo-column - * (for example, an Oracle ROWID): + * <li>{@code SCOPE} - short - not used</li> + * <li>{@code COLUMN_NAME} - String - Column name</li> + * <li>{@code DATA_TYPE} - int - The SQL data type, as defined in {@code + * java.sql.Types}</li> + * <li>{@code TYPE_NAME} - String - The SQL type name, data source dependent + * </li> + * <li>{@code COLUMN_SIZE} - int - Precision for numeric types</li> + * <li>{@code BUFFER_LENGTH} - int - Length of a column value in bytes</li> + * <li>{@code DECIMAL_DIGITS} - short - Number of digits after the decimal + * point</li> + * <li>{@code PSEUDO_COLUMN} - short - If this is a pseudo-column (for + * example, an Oracle {@code ROWID}): * <ul> - * <li>DatabaseMetaData.bestRowUnknown - don't know whether this is a - * pseudo column</li> - * <li>DatabaseMetaData.bestRowNotPseudo - column is not pseudo</li> - * <li>DatabaseMetaData.bestRowPseudo - column is a pseudo column</li> + * <li>{@code DatabaseMetaData.bestRowUnknown} - don't know whether this is + * a pseudo column</li> + * <li>{@code DatabaseMetaData.bestRowNotPseudo} - column is not pseudo</li> + * <li>{@code DatabaseMetaData.bestRowPseudo} - column is a pseudo column</li> * </ul> * </li> * </ol> + * </p> * * @param catalog - * a Catalog Name. <code>null</code> is used to imply no - * narrowing of the search using Catalog Name. Otherwise, the - * name must match a Catalog Name held in the database, with "" - * used to retrieve those without a Catalog Name. + * a catalog name. {@code null} is used to imply no narrowing of + * the search using catalog name. Otherwise, the name must match + * a catalog name held in the database, with "" used to retrieve + * those without a catalog name. * @param schema - * a Schema Name Pattern. <code>null</code> is used to imply no - * narrowing of the search using Schema Name. Otherwise, the name - * must match a Schema name in the database, with "" used to - * retrieve those without a Schema name. + * a schema name pattern. {@code null} is used to imply no + * narrowing of the search using schema names. Otherwise, the + * name must match a schema name in the database, with "" used to + * retrieve those without a schema name. * @param table * a table name. It must match the name of a table in the * database. - * @return a ResultSet containing the descriptions, one row for each column, - * in the format defined above. + * @return a {@code ResultSet} containing the descriptions, one row for each + * column, in the format defined above. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException; /** - * Determine if a visible row insert can be detected by calling - * ResultSet.rowInserted. + * Determines whether a visible row insert can be detected by calling {@code + * ResultSet.rowInserted}. * * @param type - * the ResultSet type. This may be one of - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> or - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code> or - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * @return <code>true</code> if ResultSet.rowInserted detects a visible - * row insert otherwise <code>false</code>. + * the {@code ResultSet} type. This may be one of {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} or {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE} or {@code + * ResultSet.TYPE_FORWARD_ONLY}, + * @return {@code true} if {@code ResultSet.rowInserted} detects a visible + * row insert otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @see ResultSet#rowInserted() + * @since Android 1.0 */ public boolean insertsAreDetected(int type) throws SQLException; @@ -2049,1033 +2243,1114 @@ public interface DatabaseMetaData { * Determine whether a fully qualified table name is prefixed or suffixed to * a fully qualified table name. * - * @return <code>true</code> if the catalog appears at the start of a - * fully qualified table name, <code>false</code> otherwise. + * @return {@code true} if the catalog appears at the start of a fully + * qualified table name, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean isCatalogAtStart() throws SQLException; /** - * Determine if the database is in read-only mode. + * Determines whether the database is in read-only mode. * - * @return <code>true</code> if the database is in read-only mode, - * <code>false</code> otherwise. + * @return {@code true} if the database is in read-only mode, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean isReadOnly() throws SQLException; /** - * Determine if updates are made to a copy of, or directly on, Large Objects - * (LOBs). + * Determines whether updates are made to a copy of, or directly on, Large Objects + * ({@code LOB}s). * - * @return <code>true</code> if updates are made to a copy of the Large - * Object, <code>false</code> otherwise + * @return {@code true} if updates are made to a copy of the Large Object, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean locatorsUpdateCopy() throws SQLException; /** - * Determine if the database handles concatenations between - * <code>NULL</code> and non-<code>NULL</code> values by producing a - * <code>NULL</code> output. + * Determines whether the database handles concatenations between {@code NULL} and + * non-{@code NULL} values by producing a {@code NULL} output. * - * @return <code>true</code> if <code>NULL</code> to non-<code>NULL</code> - * concatenations produce a <code>NULL</code> result, - * <code>false</code> otherwise. + * @return {@code true} if {@code NULL} to non-{@code NULL} concatenations + * produce a {@code NULL} result, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean nullPlusNonNullIsNull() throws SQLException; /** - * Determine if <code>NULL</code> values are always sorted to the end of - * sorted results regardless of requested sort order. This means that they - * will appear at the end of sorted lists whatever other non-<code>NULL</code> - * values may be present. + * Determines whether {@code NULL} values are always sorted to the end of sorted + * results regardless of requested sort order. This means that they will + * appear at the end of sorted lists whatever other non-{@code NULL} values + * may be present. * - * @return <code>true</code> if <code>NULL</code> values are sorted at - * the end, <code>false</code> otherwise + * @return {@code true} if {@code NULL} values are sorted at the end, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean nullsAreSortedAtEnd() throws SQLException; /** - * Determine if <code>NULL</code> values are always sorted at the start of - * the sorted list, irrespective of the sort order. This means that they - * appear at the start of sorted lists, whatever other values may be - * present. + * Determines whether {@code NULL} values are always sorted at the start of the + * sorted list, irrespective of the sort order. This means that they appear + * at the start of sorted lists, whatever other values may be present. * - * @return <code>true</code> if <code>NULL</code> values are sorted at - * the start, <code>false</code> otherwise + * @return {@code true} if {@code NULL} values are sorted at the start, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean nullsAreSortedAtStart() throws SQLException; /** - * Determine if <code>NULL</code> values are sorted high - i.e. they are - * sorted as if they are higher than any other values. + * Determines whether {@code NULL} values are sorted high - i.e. they are sorted + * as if they are higher than any other values. * - * @return <code>true</code> if <code>NULL</code> values are sorted - * high, <code>false</code> otherwise. + * @return {@code true} if {@code NULL} values are sorted high, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean nullsAreSortedHigh() throws SQLException; /** - * Determine if <code>NULL</code> values are sorted low - ie they are - * sorted as if they are lower than any other values. + * Determines whether {@code NULL} values are sorted low - i.e. they are sorted as + * if they are lower than any other values. * - * @return <code>true</code> if <code>NULL</code> values are sorted low, - * <code>false</code> otherwise. + * @return {@code true} if {@code NULL} values are sorted low, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean nullsAreSortedLow() throws SQLException; /** - * Determine if deletes made by others are visible, for a specified - * ResultSet type. + * Determines whether deletes made by others are visible, for a specified {@code + * ResultSet} type. * * @param type - * the type of the ResultSet. It may be either - * <code>ResultSet.TYPE_FORWARD_ONLY</code> or - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>) - * @return <code>true</code> if others' deletes are visible, - * <code>false</code> otherwise. + * the type of the {@code ResultSet}. It may be either {@code + * ResultSet.TYPE_FORWARD_ONLY} or {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE}) + * @return {@code true} if others' deletes are visible, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean othersDeletesAreVisible(int type) throws SQLException; /** - * Determine if inserts made by others are visible, for a specified - * ResultSet type. + * Determines whether inserts made by others are visible, for a specified {@code + * ResultSet} type. * * @param type - * the type of the ResultSet. May be - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, or - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if others' inserts are visible otherwise - * <code>false</code>. + * the type of the {@code ResultSet}. May be {@code + * ResultSet.TYPE_FORWARD_ONLY}, or {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if others' inserts are visible, otherwise {@code + * false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean othersInsertsAreVisible(int type) throws SQLException; /** - * Determine if updates made by others are visible, for a specified - * ResultSet type. + * Determines whether updates made by others are visible, for a specified {@code + * ResultSet} type. * * @param type - * the type of the ResultSet. May be - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, or - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if others' inserts are visible otherwise - * <code>false</code>. + * the type of the {@code ResultSet}. May be {@code + * ResultSet.TYPE_FORWARD_ONLY}, or {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if others' inserts are visible, otherwise {@code + * false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean othersUpdatesAreVisible(int type) throws SQLException; /** - * Determine if a ResultSet's own deletes are visible, for a specified - * ResultSet type. + * Determines whether a {@code ResultSet} can see its own deletes, for a + * specified {@code ResultSet} type. * * @param type - * the type of the ResultSet: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if the delete's are seen by the own ResultSet - * otherwise <code>false</code>. + * the type of the {@code ResultSet}: {@code + * ResultSet.TYPE_FORWARD_ONLY}, {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if the deletes are seen by the {@code + * ResultSet} itself, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean ownDeletesAreVisible(int type) throws SQLException; /** - * Determine if its own inserts are visible to a given ResultSet type. + * Determines whether a {@code ResultSet} can see its own inserts, for a + * specified {@code ResultSet} type. * * @param type - * the type of the ResultSet: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if inserts are visible for this type - * <code>false</code> otherwise. + * the type of the {@code ResultSet}: {@code + * ResultSet.TYPE_FORWARD_ONLY}, {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if the inserts are seen by the {@code + * ResultSet} itself, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean ownInsertsAreVisible(int type) throws SQLException; /** - * Determine if for a supplied type of ResultSet, the ResultSet's own - * updates are visible. + * Determines whether a {@code ResultSet} can see its own updates, for a + * specified {@code ResultSet} type. * * @param type - * the type of the ResultSet: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if updates are visible to in this ResultSet - * type otherwise <code>false</code>. + * the type of the {@code ResultSet}: {@code + * ResultSet.TYPE_FORWARD_ONLY}, {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if the updates are seen by the {@code + * ResultSet} itself, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean ownUpdatesAreVisible(int type) throws SQLException; /** - * Determine whether the database treats SQL identifiers that are in mixed - * case (and unquoted) as case insensitive. If true then the database stores - * them in lower case. + * Determines whether the database treats SQL identifiers that are in mixed + * case (and unquoted) as case insensitive. If {@code true} then the + * database stores them in lower case. * - * @return <code>true</code> if unquoted SQL identifiers are stored in - * lower case, <code>false</code> otherwise. + * @return {@code true} if unquoted SQL identifiers are stored in lower + * case, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesLowerCaseIdentifiers() throws SQLException; /** - * Determine whether the database considers mixed case quoted SQL + * Determines whether the database considers mixed case quoted SQL * identifiers as case insensitive and stores them in lower case. * - * @return <code>true</code> if quoted SQL identifiers are stored in lower - * case, <code>false</code> otherwise. + * @return {@code true} if quoted SQL identifiers are stored in lower case, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesLowerCaseQuotedIdentifiers() throws SQLException; /** - * Determine whether the database considers mixed case unquoted SQL + * Determines whether the database considers mixed case unquoted SQL * identifiers as case insensitive and stores them in mixed case. * - * @return <code>true</code> if unquoted SQL identifiers as stored in - * mixed case, <code>false</code> otherwise. + * @return {@code true} if unquoted SQL identifiers as stored in mixed case, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesMixedCaseIdentifiers() throws SQLException; /** - * Determine whether the database considers identifiers as case insensitive + * Determines whether the database considers identifiers as case insensitive * if they are mixed case quoted SQL. The database stores them in mixed * case. * - * @return <code>true</code> if quoted SQL identifiers are stored in mixed - * case, <code>false</code> otherwise. + * @return {@code true} if quoted SQL identifiers are stored in mixed case, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesMixedCaseQuotedIdentifiers() throws SQLException; /** - * Determine whether the database considers mixed case unquoted SQL + * Determines whether the database considers mixed case unquoted SQL * identifiers as case insensitive and stores them in upper case. * - * @return <code>true</code> if unquoted SQL identifiers are stored in - * upper case, <code>false</code> otherwise. + * @return {@code true} if unquoted SQL identifiers are stored in upper + * case, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesUpperCaseIdentifiers() throws SQLException; /** - * Determine whether the database considers mixed case quoted SQL + * Determines whether the database considers mixed case quoted SQL * identifiers as case insensitive and stores them in upper case. * - * @return <code>true</code> if quoted SQL identifiers are stored in upper - * case, <code>false</code> otherwise. + * @return {@code true} if quoted SQL identifiers are stored in upper case, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean storesUpperCaseQuotedIdentifiers() throws SQLException; /** - * Determine if the database supports ALTER TABLE operation with add column. + * Determines whether the database supports {@code ALTER TABLE} operation with + * {@code ADD COLUMN}. * - * @return <code>true</code> if ALTER TABLE with add column is supported, - * <code>false</code> otherwise. + * @return {@code true} if {@code ALTER TABLE} with {@code ADD COLUMN} is + * supported, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsAlterTableWithAddColumn() throws SQLException; /** - * Determine if the database supports ALTER TABLE operation with drop - * column. + * Determines whether the database supports {@code ALTER TABLE} operation with + * {@code DROP COLUMN}. * - * @return <code>true</code> if ALTER TABLE with drop column is supported, - * <code>false</code> otherwise. + * @return {@code true} if {@code ALTER TABLE} with {@code DROP COLUMN} is + * supported, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsAlterTableWithDropColumn() throws SQLException; /** - * Determine if the database supports the ANSI92 entry level SQL grammar. + * Determines whether the database supports the ANSI92 entry level SQL grammar. * - * @return <code>true</code> if the ANSI92 entry level SQL grammar is - * supported, <code>false</code> otherwise. + * @return {@code true} if the ANSI92 entry level SQL grammar is supported, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsANSI92EntryLevelSQL() throws SQLException; /** - * Determine if the database supports the ANSI92 full SQL grammar. + * Determines whether the database supports the ANSI92 full SQL grammar. * - * @return <code>true</code> if the ANSI92 full SQL grammar is supported, - * <code>false</code> otherwise. + * @return {@code true} if the ANSI92 full SQL grammar is supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsANSI92FullSQL() throws SQLException; /** - * Determine if the database supports the ANSI92 intermediate SQL Grammar. + * Determines whether the database supports the ANSI92 intermediate SQL Grammar. * - * @return <code>true</code> if the ANSI92 intermediate SQL grammar is - * supported, <code>false</code> otherwise. + * @return {@code true} if the ANSI92 intermediate SQL grammar is supported, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsANSI92IntermediateSQL() throws SQLException; /** - * Determine if the database supports Batch Updates. + * Determines whether the database supports batch updates. * - * @return <code>true</code> if batch updates are supported, - * <code>false</code> otherwise. + * @return {@code true} if batch updates are supported, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsBatchUpdates() throws SQLException; /** - * Determine whether catalog names may be used in data manipulation + * Determines whether catalog names may be used in data manipulation * statements. * - * @return <code>true</code> if catalog names can be used in data - * manipulation statements, <code>false</code> otherwise. + * @return {@code true} if catalog names can be used in data manipulation + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCatalogsInDataManipulation() throws SQLException; /** - * Determine if catalog names can be used in Index Definition statements. + * Determines whether catalog names can be used in index definition statements. * - * @return <code>true</code> if catalog names can be used in Index - * Definition statements, <code>false</code> otherwise. + * @return {@code true} if catalog names can be used in index definition + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCatalogsInIndexDefinitions() throws SQLException; /** - * Determine if catalog names can be used in privilege definition + * Determines whether catalog names can be used in privilege definition * statements. * - * @return <code>true</code> if catalog names can be used in privilege - * definition statements, <code>false</code> otherwise. + * @return {@code true} if catalog names can be used in privilege definition + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException; /** - * Determine if catalog names can be used in procedure call statements. + * Determines whether catalog names can be used in procedure call statements. * - * @return <code>true</code> if catalog names can be used in procedure - * call statements. + * @return {@code true} if catalog names can be used in procedure call + * statements. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCatalogsInProcedureCalls() throws SQLException; /** - * Determine if catalog names may be used in table definition statements. + * Determines whether catalog names may be used in table definition statements. * - * @return <code>true</code> if catalog names can be used in definition - * statements, <code>false</code> otherwise. + * @return {@code true} if catalog names can be used in definition + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCatalogsInTableDefinitions() throws SQLException; /** - * Determine if the database supports column aliasing. + * Determines whether the database supports column aliasing. * <p> * If aliasing is supported, then the SQL AS clause is used to provide names * for computed columns and provide alias names for columns. + * </p> * - * @return <code>true</code> if column aliasing is supported, - * <code>false</code> otherwise. + * @return {@code true} if column aliasing is supported, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. */ public boolean supportsColumnAliasing() throws SQLException; /** - * Determine if the database supports the CONVERT operation between SQL - * types. + * Determines whether the database supports the {@code CONVERT} operation between + * SQL types. * - * @return <code>true</code> if the CONVERT operation is supported, - * <code>false</code> otherwise. + * @return {@code true} if the {@code CONVERT} operation is supported, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsConvert() throws SQLException; /** - * Determine if the database supports CONVERT operation for two supplied SQL - * types. + * Determines whether the database supports {@code CONVERT} operation for two + * supplied SQL types. * * @param fromType - * the Type to convert from, as defined by - * <code>java.sql.Types</code> + * the Type to convert from, as defined by {@code java.sql.Types} * @param toType - * the Type to convert to, as defined by - * <code>java.sql.Types</code> - * @return <code>true</code> if the CONVERT operation is supported for - * these types, <code>false</code> otherwise. + * the Type to convert to, as defined by {@code java.sql.Types} + * @return {@code true} if the {@code CONVERT} operation is supported for + * these types, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsConvert(int fromType, int toType) throws SQLException; /** - * Determine if the database supports the Core SQL Grammar for ODBC. + * Determines whether the database supports the Core SQL Grammar for ODBC. * - * @return <code>true</code> if the Core SQL Grammar is supported, - * <code>false</code> otherwise. + * @return {@code true} if the Core SQL Grammar is supported, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCoreSQLGrammar() throws SQLException; /** - * Determine if the database supports correlated sub-queries. + * Determines whether the database supports correlated sub-queries. * - * @return <code>true</code> if the database does support correlated - * sub-queries and <code>false</code> otherwise. + * @return {@code true} if the database does support correlated sub-queries + * and {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsCorrelatedSubqueries() throws SQLException; /** - * Determine if the database allows both data definition and data + * Determines whether the database allows both data definition and data * manipulation statements inside a transaction. * - * @return <code>true</code> if both types of statement are permitted, - * <code>false</code> otherwise. + * @return {@code true} if both types of statement are permitted, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException; /** - * Determine if the database only allows data manipulation statements inside + * Determines whether the database only allows data manipulation statements inside * a transaction. * - * @return <code>true</code> if only data manipulation statements are - * permitted, <code>false</code> otherwise. + * @return {@code true} if data manipulation statements are permitted only within a transaction, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsDataManipulationTransactionsOnly() throws SQLException; /** - * Determine if table correlation names are restricted to be different from + * Determines whether table correlation names are required to be different from * the names of the tables, when they are supported. * - * @return <code>true</code> if correlation names must be different to - * table names, <code>false</code> otherwise. + * @return {@code true} if correlation names must be different from table + * names, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsDifferentTableCorrelationNames() throws SQLException; /** - * Determine whether expressions in ORDER BY lists are supported. + * Determines whether expressions in {@code ORDER BY} lists are supported. * - * @return <code>true</code> if expressions in ORDER BY lists are + * @return {@code true} if expressions in {@code ORDER BY} lists are * supported. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsExpressionsInOrderBy() throws SQLException; /** - * Determine whether the Extended SQL Grammar for ODBC is supported. + * Determines whether the Extended SQL Grammar for ODBC is supported. * - * @return <code>true</code> if the Extended SQL Grammar is supported, - * <code>false</code> otherwise. + * @return {@code true} if the Extended SQL Grammar is supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsExtendedSQLGrammar() throws SQLException; /** - * Determine if the database supports full nested outer joins. + * Determines whether the database supports full nested outer joins. * - * @return <code>true</code> if full nested outer joins are supported, - * <code>false</code> otherwise. + * @return {@code true} if full nested outer joins are supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsFullOuterJoins() throws SQLException; /** - * Determine if auto generated keys can be returned when a statement + * Determines whether auto generated keys can be returned when a statement * executes. * - * @return <code>true</code> if auto generated keys can be returned, - * <code>false</code> otherwise. + * @return {@code true} if auto generated keys can be returned, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsGetGeneratedKeys() throws SQLException; /** - * Determine if the database supports a form of GROUP BY clause. + * Determines whether the database supports {@code GROUP BY} clauses. * - * @return <code>true</code> if a form of GROUP BY clause is supported, - * <code>false</code> otherwise. + * @return {@code true} if the {@code GROUP BY} clause is supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsGroupBy() throws SQLException; /** - * Determine if the database supports using a column name in a GROUP BY - * clause not included in the SELECT statement as long as all of the columns - * in the SELECT statement are used in the GROUP BY clause. + * Determines whether the database supports using a column name in a {@code GROUP + * BY} clause not included in the {@code SELECT} statement as long as all of + * the columns in the {@code SELECT} statement are used in the {@code GROUP + * BY} clause. * - * @return <code>true</code> if GROUP BY clauses can use column names in - * this way, <code>false</code> otherwise. + * @return {@code true} if {@code GROUP BY} clauses can use column names in + * this way, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsGroupByBeyondSelect() throws SQLException; /** - * Determine if the database supports using a column name in a GROUP BY - * clause that is not in the SELECT statement. + * Determines whether the database supports using a column name in a {@code GROUP + * BY} clause that is not in the {@code SELECT} statement. * - * @return <code>true</code> if GROUP BY clause can use a column name not - * in the SELECT statement, <code>false</code> otherwise. + * @return {@code true} if {@code GROUP BY} clause can use a column name not + * in the {@code SELECT} statement, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsGroupByUnrelated() throws SQLException; /** - * Determine whether the database supports SQL Integrity Enhancement + * Determines whether the database supports SQL Integrity Enhancement * Facility. * - * @return <code>true</code> if the Integrity Enhancement Facility is - * supported, <code>false</code> otherwise. + * @return {@code true} if the Integrity Enhancement Facility is supported, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsIntegrityEnhancementFacility() throws SQLException; /** - * Determine if the database supports using a LIKE escape clause. + * Determines whether the database supports a {@code LIKE} escape clause. * - * @return <code>true</code> if LIKE escape clause is supported, - * <code>false</code> otherwise + * @return {@code true} if LIKE escape clause is supported, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsLikeEscapeClause() throws SQLException; /** - * Determine if the database provides limited support for outer Join + * Determines whether the database provides limited support for outer join * operations. * - * @return <code>true</code> if there is limited support for outer Join - * operations, <code>false</code> otherwise. This will be - * <code>true</code> if <code>supportsFullOuterJoins</code> - * returns <code>true</code>. + * @return {@code true} if there is limited support for outer join + * operations, {@code false} otherwise. This will be {@code true} if + * {@code supportsFullOuterJoins} returns {@code true}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsLimitedOuterJoins() throws SQLException; /** - * Determine if the database supports Minimum SQL Grammar for ODBC. + * Determines whether the database supports Minimum SQL Grammar for ODBC. * - * @return <code>true</code> if the Minimum SQL Grammar is supported, - * <code>false</code> otherwise. + * @return {@code true} if the Minimum SQL Grammar is supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMinimumSQLGrammar() throws SQLException; /** - * Determine if the database treats mixed case unquoted SQL identifiers as + * Determines whether the database treats mixed case unquoted SQL identifiers as * case sensitive storing them in mixed case. * - * @return <code>true</code> if unquoted SQL identifiers are stored in - * mixed case, <code>false</code> otherwise. + * @return {@code true} if unquoted SQL identifiers are stored in mixed + * case, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMixedCaseIdentifiers() throws SQLException; /** - * Determine whether the database considers mixed case quoted SQL + * Determines whether the database considers mixed case quoted SQL * identifiers as case sensitive, storing them in mixed case. * - * @return <code>true</code> if quoted SQL identifiers are stored in mixed - * case, <code>false</code> otherwise. + * @return {@code true} if quoted SQL identifiers are stored in mixed case, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException; /** - * Determine if it is possible for a single CallableStatement to return - * multiple ResultSets simultaneously. + * Determines whether it is possible for a single {@code CallableStatement} to + * return multiple {@code ResultSet}s simultaneously. * - * @return <code>true</code> if a single CallableStatement can return - * multiple ResultSets simultaneously, <code>false</code> + * @return {@code true} if a single {@code CallableStatement} can return + * multiple {@code ResultSet}s simultaneously, {@code false} * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMultipleOpenResults() throws SQLException; /** - * Determine whether retrieving multiple ResultSets from a single call to - * the <code>execute</code> method is supported. + * Determines whether retrieving multiple {@code ResultSet}s from a single + * call to the {@code execute} method is supported. * - * @return <code>true</code> if multiple ResultSets can be retrieved, - * <code>false</code> otherwise. + * @return {@code true} if multiple {@code ResultSet}s can be retrieved, + * {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMultipleResultSets() throws SQLException; /** - * Determine whether multiple transactions in progress at at time on + * Determines whether multiple simultaneous transactions on * different connections are supported. * - * @return <code>true</code> if multiple open transactions are supported, - * <code>false</code> otherwise. + * @return {@code true} if multiple open transactions are supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsMultipleTransactions() throws SQLException; /** - * Determine whether call-able statements with named parameters is - * supported. + * Determines whether callable statements with named parameters is supported. * - * @return <code>true</code> if named parameters can be used with - * call-able statements, <code>false</code> otherwise. + * @return {@code true} if named parameters can be used with callable + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsNamedParameters() throws SQLException; /** - * Determine if columns in the database can be defined as non-nullable. + * Determines whether columns in the database can be defined as non-nullable. * - * @return <code>true</code> if Columns can be defined non-nullable, - * <code>false</code> otherwise. + * @return {@code true} if columns can be defined non-nullable, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsNonNullableColumns() throws SQLException; /** - * Determine whether keeping Cursors open across Commit operations is + * Determines whether keeping cursors open across commit operations is * supported. * - * @return <code>true</code> if Cursors can be kept open across Commit - * operations, <code>false</code> if they might get closed. + * @return {@code true} if cursors can be kept open across commit + * operations, {@code false} if they might get closed. * @throws SQLException - * a database error occurred + * a database error occurred. */ public boolean supportsOpenCursorsAcrossCommit() throws SQLException; /** - * Determine if the database can keep Cursors open across Rollback + * Determines whether the database can keep cursors open across rollback * operations. * - * @return <code>true</code> if Cursors can be kept open across Rollback - * operations, <code>false</code> if they might get closed. + * @return {@code true} if cursors can be kept open across rollback + * operations, {@code false} if they might get closed. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsOpenCursorsAcrossRollback() throws SQLException; /** - * Determine whether keeping Statements open across Commit operations is + * Determines whether keeping statements open across commit operations is * supported. * - * @return <code>true</code> if Statements can be kept open, - * <code>false</code> if they might not. + * @return {@code true} if statements can be kept open, {@code false} if + * they might not. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsOpenStatementsAcrossCommit() throws SQLException; /** - * Determine whether keeping Statements open across Rollback operations is + * Determines whether keeping statements open across rollback operations is * supported. * - * @return <code>true</code> if Statements can be kept open, - * <code>false</code> if they might not. + * @return {@code true} if statements can be kept open, {@code false} if + * they might not. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsOpenStatementsAcrossRollback() throws SQLException; /** - * Determine whether using a column in an ORDER BY clause that is not in the - * SELECT statement is supported. + * Determines whether using a column in an {@code ORDER BY} clause that is + * not in the {@code SELECT} statement is supported. * - * @return <code>true</code> if it is possible to ORDER using a column not - * in the SELECT, <code>false</code> otherwise. + * @return {@code true} if it is possible to {@code ORDER} using a column + * not in the {@code SELECT}, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsOrderByUnrelated() throws SQLException; /** - * Determine whether outer join operations are supported. + * Determines whether outer join operations are supported. * - * @return <code>true</code> if outer join operations are supported, - * <code>false</code> otherwise. + * @return {@code true} if outer join operations are supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsOuterJoins() throws SQLException; /** - * Determine whether positioned DELETE statements are supported. + * Determines whether positioned {@code DELETE} statements are supported. * - * @return <code>true</code> if the database supports positioned DELETE + * @return {@code true} if the database supports positioned {@code DELETE} * statements. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsPositionedDelete() throws SQLException; /** - * Determine whether positioned UPDATE statements are supported. + * Determines whether positioned {@code UPDATE} statements are supported. * - * @return <code>true</code> if the database supports positioned UPDATE - * statements, <code>false</code> otherwise. + * @return {@code true} if the database supports positioned {@code UPDATE} + * statements, {@code false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsPositionedUpdate() throws SQLException; /** - * Determine whether there is support for a given concurrency style for the - * given ResultSet. + * Determines whether there is support for a given concurrency style for the + * given {@code ResultSet}. * * @param type - * the ResultSet type, as defined in - * <code>java.sql.ResultSet</code>: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> + * the {@code ResultSet} type, as defined in {@code + * java.sql.ResultSet}: + * <ul> + * <li>{@code ResultSet.TYPE_FORWARD_ONLY}</li> + * <li>{@code ResultSet.TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@code ResultSet.TYPE_SCROLL_SENSITIVE}</li> + * </ul> * @param concurrency - * a concurrency type, which may be one of - * <code>ResultSet.CONCUR_READ_ONLY</code> or - * <code>ResultSet.CONCUR_UPDATABLE</code>. - * @return <code>true</code> if that concurrency and ResultSet type - * pairing is supported otherwise <code>false</code>. + * a concurrency type, which may be one of {@code + * ResultSet.CONCUR_READ_ONLY} or {@code + * ResultSet.CONCUR_UPDATABLE}. + * @return {@code true} if that concurrency and {@code ResultSet} type + * pairing is supported otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException; /** - * Determine whether the supplied ResultSet holdability is supported. + * Determines whether the supplied {@code ResultSet} holdability mode is + * supported. * * @param holdability - * as specified in java.sql.ResultSet: - * ResultSet.HOLD_CURSORS_OVER_COMMIT or - * ResultSet.CLOSE_CURSORS_AT_COMMIT - * @return <code>true</code> if the given ResultSet holdability is - * supported and if it isn't then <code>false</code>. + * as specified in {@code java.sql.ResultSet}: {@code + * ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code + * ResultSet.CLOSE_CURSORS_AT_COMMIT} + * @return {@code true} if the given ResultSet holdability is supported and + * if it isn't then {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsResultSetHoldability(int holdability) throws SQLException; /** - * Determine whether the supplied ResultSet type is supported. + * Determines whether the supplied {@code ResultSet} type is supported. * * @param type - * the ResultSet type as defined in java.sql.ResultSet: - * <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> if the ResultSet type is supported, - * <code>false</code> otherwise. + * the {@code ResultSet} type as defined in {@code + * java.sql.ResultSet}: {@code ResultSet.TYPE_FORWARD_ONLY}, + * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} if the {@code ResultSet} type is supported, {@code + * false} otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsResultSetType(int type) throws SQLException; /** - * Determine whether Savepoints for transactions are supported. + * Determines whether savepoints for transactions are supported. * - * @return <code>true</code> if Savepoints are supported, - * <code>false</code> otherwise. + * @return {@code true} if savepoints are supported, {@code false} + * otherwise. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSavepoints() throws SQLException; /** - * Determine whether a schema name may be used in a data manipulation + * Determines whether a schema name may be used in a data manipulation * statement. * - * @return <code>true</code> if a schema name can be used in a data - * manipulation otherwise <code>false</code>. + * @return {@code true} if a schema name can be used in a data manipulation, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSchemasInDataManipulation() throws SQLException; /** - * Determine whether a schema name may be used in an index definition + * Determines whether a schema name may be used in an index definition * statement. * - * @return <code>true</code> if a schema name can be used in an index - * definition otherwise <code>false</code>. + * @return {@code true} if a schema name can be used in an index definition, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSchemasInIndexDefinitions() throws SQLException; /** - * Determine whether a database schema name can be used in a privilege + * Determines whether a database schema name can be used in a privilege * definition statement. * - * @return <code>true</code> if a database schema name may be used in a - * privilege definition otherwise <code>false</code> + * @return {@code true} if a database schema name may be used in a privilege + * definition, otherwise {@code false} * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException; /** - * Determine if a procedure call statement may be contain in a schema name. + * Determines whether a procedure call statement may be contain in a schema name. * - * @return <code>true</code> if a schema name can be used in a procedure - * call otherwise <code>false</code>. + * @return {@code true} if a schema name can be used in a procedure call, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSchemasInProcedureCalls() throws SQLException; /** - * Determine if a schema name can be used in a table definition statement. + * Determines whether a schema name can be used in a table definition statement. * - * @return <code>true</code> if a schema name can be used in a table - * definition otherwise <code>false</code>. + * @return {@code true} if a schema name can be used in a table definition, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSchemasInTableDefinitions() throws SQLException; /** - * Determine if this <code>SELECT FOR UPDATE</code> statements ar - * supported. + * Determines whether the {@code SELECT FOR UPDATE} statement is supported. * - * @return <code>true</code> if <code>SELECT FOR UPDATE</code> - * statements are supported otherwise <code>false</code>. + * @return {@code true} if {@code SELECT FOR UPDATE} statements are + * supported, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSelectForUpdate() throws SQLException; /** - * Determine whether statement pooling is supported. + * Determines whether statement pooling is supported. * - * @return <code>true</code> of the database does support statement - * pooling otherwise <code>false</code>. + * @return {@code true} of the database does support statement pooling, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsStatementPooling() throws SQLException; /** - * Determine whether stored procedure calls using the stored procedure + * Determines whether stored procedure calls using the stored procedure * escape syntax is supported. * - * @return <code>true</code> if stored procedure calls using the stored - * procedure escape syntax are supported otherwise - * <code>false</code>. + * @return {@code true} if stored procedure calls using the stored procedure + * escape syntax are supported, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsStoredProcedures() throws SQLException; /** - * Determine whether subqueries in comparison expressions are supported. + * Determines whether subqueries in comparison expressions are supported. * - * @return <code>true</code> if subqueries are supported in comparison + * @return {@code true} if subqueries are supported in comparison * expressions. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSubqueriesInComparisons() throws SQLException; /** - * Determine whether subqueries in EXISTS expressions are supported. + * Determines whether subqueries in {@code EXISTS} expressions are supported. * - * @return <code>true</code> if subqueries are supported in EXISTS - * expressions otherwise <code>false</code>. + * @return {@code true} if subqueries are supported in {@code EXISTS} + * expressions, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSubqueriesInExists() throws SQLException; /** - * Determine whether subqueries in <code>IN</code> statements are - * supported. + * Determines whether subqueries in {@code IN} statements are supported. * - * @return <code>true</code> if subqueries are supported in IN statements - * otherwise <code>false</code>. + * @return {@code true} if subqueries are supported in {@code IN} statements, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSubqueriesInIns() throws SQLException; /** - * Determine whether subqueries in quantified expressions are supported. + * Determines whether subqueries in quantified expressions are supported. * - * @return <code>true</code> if subqueries are supported otherwise - * <code>false</code>. + * @return {@code true} if subqueries are supported, otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsSubqueriesInQuantifieds() throws SQLException; /** - * Determine whether the database has table correlation names support. + * Determines whether the database has table correlation names support. * - * @return <code>true</code> if table correlation names are supported - * otherwise <code>false</code>. + * @return {@code true} if table correlation names are supported, otherwise + * {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsTableCorrelationNames() throws SQLException; /** - * Determine whether a specified transaction isolation level is supported. + * Determines whether a specified transaction isolation level is supported. * * @param level - * the transaction isolation level, as specified in - * <code>java.sql.Connection</code>: - * <code>TRANSACTION_NONE</code>, - * <code>TRANSACTION_READ_COMMITTED</code>, - * <code>TRANSACTION_READ_UNCOMMITTED</code>, - * <code>TRANSACTION_REPEATABLE_READ</code>, - * <code>TRANSACTION_SERIALIZABLE</code> - * @return <code>true</code> if the specific isolation level is supported - * otherwise <code>false</code>. + * the transaction isolation level, as specified in {@code + * java.sql.Connection}: {@code TRANSACTION_NONE}, {@code + * TRANSACTION_READ_COMMITTED}, {@code + * TRANSACTION_READ_UNCOMMITTED}, {@code + * TRANSACTION_REPEATABLE_READ}, {@code TRANSACTION_SERIALIZABLE} + * @return {@code true} if the specific isolation level is supported, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsTransactionIsolationLevel(int level) throws SQLException; /** - * Determine whether transactions are supported. + * Determines whether transactions are supported. * <p> - * If transactions are not supported, then the <code>commit</code> method - * does nothing and the transaction isolation level is always - * <code>TRANSACTION_NONE</code>. + * If transactions are not supported, then the {@code commit} method does + * nothing and the transaction isolation level is always {@code + * TRANSACTION_NONE}. + * </p> * - * @return <code>true</code> if transactions are supported otherwise - * <code>false</code>. + * @return {@code true} if transactions are supported, otherwise {@code + * false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsTransactions() throws SQLException; /** - * Determine whether the <code>SQL UNION</code> operation is supported. + * Determines whether the {@code SQL UNION} operation is supported. * - * @return <code>true</code> of the database does support - * <code>UNION</code> otherwise <code>false</code>. + * @return {@code true} of the database does support {@code UNION}, otherwise + * {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsUnion() throws SQLException; /** - * Determine whether the <code>SQL UNION ALL</code> operation is - * supported. + * Determines whether the {@code SQL UNION ALL} operation is supported. * - * @return <code>true</code> if the database does support UNION ALL - * otherwise <code>false</code>. + * @return {@code true} if the database does support {@code UNION ALL}, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean supportsUnionAll() throws SQLException; /** - * Determine if the method <code>ResultSet.rowUpdated</code> can detect a - * visible row update. + * Determines whether the method {@code ResultSet.rowUpdated} can detect a visible + * row update for the specified {@code ResultSet} type. * * @param type - * ResultSet type: <code>ResultSet.TYPE_FORWARD_ONLY</code>, - * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or - * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> - * @return <code>true</code> detecting changes is possible otherwise - * <code>false</code>. + * {@code ResultSet} type: {@code ResultSet.TYPE_FORWARD_ONLY}, + * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code + * ResultSet.TYPE_SCROLL_SENSITIVE} + * @return {@code true} detecting changes is possible, otherwise {@code + * false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean updatesAreDetected(int type) throws SQLException; /** - * Determine if this database uses a file for each table. + * Determines whether this database uses a file for each table. * - * @return <code>true</code> if the database uses one file for each table - * otherwise <code>false</code>. + * @return {@code true} if the database uses one file for each table, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean usesLocalFilePerTable() throws SQLException; /** - * Determine whether this database uses a local file to store tables. + * Determines whether this database uses a local file to store tables. * - * @return <code>true</code> of the database does store tables in a local - * file otherwise <code>false</code>. + * @return {@code true} if the database stores tables in a local file, + * otherwise {@code false}. * @throws SQLException - * a database error occurred + * a database error occurred. + * @since Android 1.0 */ public boolean usesLocalFiles() throws SQLException; } diff --git a/sql/src/main/java/java/sql/Date.java b/sql/src/main/java/java/sql/Date.java index ce31b01..e506a43 100644 --- a/sql/src/main/java/java/sql/Date.java +++ b/sql/src/main/java/java/sql/Date.java @@ -20,35 +20,41 @@ package java.sql; import java.text.SimpleDateFormat; /** - * A Date class which can consume and produce dates in SQL Date format. + * A class which can consume and produce dates in SQL {@code Date} format. * <p> - * The SQL date format represents a date as yyyy-mm-dd. Note that this date + * Dates are represented in SQL as {@code yyyy-mm-dd}. Note that this date * format only deals with year, month and day values. There are no values for * hours, minutes, seconds. + * </p> + * This is unlike the familiar {@code java.util.Date} object, which also includes + * values for hours, minutes, seconds, and milliseconds. * <p> - * This contrasts with regular java.util.Date values, which include time values - * for hours, minutes, seconds, milliseconds. - * <p> - * Time points are handled as millisecond values - milliseconds since the epoch, - * January 1st 1970, 00:00:00.000 GMT. Time values passed to the java.sql.Date - * class are "normalized" to the time 00:00:00.000 GMT on the date implied by - * the time value. + * Time points are handled as millisecond values - milliseconds since the Epoch, + * January 1st 1970, 00:00:00.000 GMT. Time values passed to the {@code + * java.sql.Date} class are "normalized" to the time 00:00:00.000 GMT on the + * date implied by the time value. + * </p> + * + * @since Android 1.0 */ public class Date extends java.util.Date { private static final long serialVersionUID = 1511598038487230103L; /** - * @deprecated Please use the constructor {@link #Date(long)} Constructs a Date - * object corresponding to the supplied Year, Month and Day. + * Constructs a {@code Date} object corresponding to the supplied year, + * month and day. + * + * @deprecated Please use the constructor {@link #Date(long)}. * @param theYear * the year, specified as the year minus 1900. Must be in the - * range 0 to 8099. + * range {@code [0,8099]}. * @param theMonth * the month, specified as a number with 0 = January. Must be in - * the range 0 to 11. + * the range {@code [0,11]}. * @param theDay - * the day in the month. Must be in the range 1 to 31. + * the day in the month. Must be in the range {@code [1,31]}. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -57,26 +63,28 @@ public class Date extends java.util.Date { } /** - * Creates a Date which corresponds to the day implied by the supplied - * theDate milliseconds time value. + * Creates a date which corresponds to the day determined by the supplied + * milliseconds time value {@code theDate}. * - * @param theDate - + * @param theDate * a time value in milliseconds since the epoch - January 1 1970 * 00:00:00 GMT. The time value (hours, minutes, seconds, - * milliseconds) stored in the Date object is adjusted to - * correspond to 00:00:00 GMT on the day implied by the supplied + * milliseconds) stored in the {@code Date} object is adjusted to + * correspond to 00:00:00 GMT on the day determined by the supplied * time value. + * @since Android 1.0 */ public Date(long theDate) { super(normalizeTime(theDate)); } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have an hours component. - * @return does not return + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have an hours component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -86,11 +94,12 @@ public class Date extends java.util.Date { } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have a minutes component. - * @return does not return + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have a minutes component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -100,11 +109,12 @@ public class Date extends java.util.Date { } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have a seconds component. - * @return does not return + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have a seconds component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -114,12 +124,13 @@ public class Date extends java.util.Date { } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have an hours component. + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have an hours component. * @param theHours - * the number of hours to set + * the number of hours to set. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -129,12 +140,13 @@ public class Date extends java.util.Date { } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have a minutes component. + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have a minutes component. * @param theMinutes - * the number of minutes to set + * the number of minutes to set. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -144,12 +156,13 @@ public class Date extends java.util.Date { } /** - * @deprecated This method is deprecated and must not be used. SQL Date - * values do not have a seconds component. + * @deprecated This method is deprecated and must not be used. SQL {@code + * Date} values do not have a seconds component. * @param theSeconds - * the number of seconds to set + * the number of seconds to set. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -160,11 +173,11 @@ public class Date extends java.util.Date { /** * Sets this date to a date supplied as a milliseconds value. The date is - * set based on the supplied time value after removing any time elements - * finer than a day, based on zero GMT for that day. + * set based on the supplied time value and rounded to zero GMT for that day. * * @param theTime - * the time in milliseconds since the Epoch + * the time in milliseconds since the Epoch. + * @since Android 1.0 */ @Override public void setTime(long theTime) { @@ -176,9 +189,11 @@ public class Date extends java.util.Date { } /** - * Produces a string representation of the Date in SQL format + * Produces a string representation of the date in SQL format * - * @return a string representation of the Date in SQL format - "yyyy-mm-dd". + * @return a string representation of the date in SQL format - {@code + * "yyyy-mm-dd"}. + * @since Android 1.0 */ @Override public String toString() { @@ -187,15 +202,17 @@ public class Date extends java.util.Date { } /** - * Creates a Date from a string representation of a date in SQL format. + * Creates a {@code Date} from a string representation of a date in SQL + * format. * * @param dateString - * the string representation of a date in SQL format - - * "yyyy-mm-dd". - * @return the Date object + * the string representation of a date in SQL format - " {@code + * yyyy-mm-dd}". + * @return the {@code Date} object. * @throws IllegalArgumentException * if the format of the supplied string does not match the SQL * format. + * @since Android 1.0 */ public static Date valueOf(String dateString) { if (dateString == null) { diff --git a/sql/src/main/java/java/sql/Driver.java b/sql/src/main/java/java/sql/Driver.java index 7833724..c0499cb 100644 --- a/sql/src/main/java/java/sql/Driver.java +++ b/sql/src/main/java/java/sql/Driver.java @@ -20,14 +20,22 @@ package java.sql; import java.util.Properties; /** - * An Interface to a JDBC Driver. + * An interface to a JDBC driver. * <p> - * The JDBC Driver uses URLs to specify the location of specific data. URL - * format typically takes the form "xxxx:yyyy:SpecificData", where "xxxx:yyyy" - * is termed the subprotocol and is normally the same for all uses of a - * particular driver. "SpecificData" is a string which identifies the particular - * data source that the driver should use. - * + * The JDBC driver uses URLs to specify the location of specific data. URL + * format typically takes the form " {@code xxxx:yyyy:SpecificData}", where " + * {@code xxxx:yyyy}" is referred to as the <i>subprotocol</i> and is normally + * the same for all of a particular driver. " {@code SpecificData}" is a string + * which identifies the particular data source that the driver should use. + * </p> + * <p> + * A driver needs to be registered with a {@link DriverManager}. It is + * registered and instantiated by calling {@code Class.forName("DriverURL")} + * with the URL string as argument. + * </p> + * @see DriverManager + * + * @since Android 1.0 */ public interface Driver { @@ -37,43 +45,48 @@ public interface Driver { * * @param url * the URL to connect to. - * @return true if the driver thinks that is can open a connection to the - * supplied URL, false otherwise. Typically, the driver will respond - * true if it thinks that it can handle the subprotocol specified by - * the driver. + * @return {@code true} if the driver thinks that is can open a connection + * to the supplied URL, {@code false} otherwise. Typically, the + * driver will respond {@code true} if it thinks that it can handle + * the subprotocol specified by the driver. * @throws SQLException + * if a database error occurs. + * @since Android 1.0 */ public boolean acceptsURL(String url) throws SQLException; /** - * Attempts to make a database connection to a datasource specified by a + * Attempts to make a database connection to a data source specified by a * supplied URL. * * @param url - * the url to connect. + * the URL to connect. * @param info * some properties that should be used in establishing the * connection. The properties consist of name/value pairs of - * Strings. Normally, a connection to a database requires at - * least two properties - for "user" and "password" in order to - * pass authentication to the database. - * @return a Connection object representing the connection to the database. + * strings. Normally, a connection to a database requires at + * least two properties - for {@code "user"} and {@code + * "password"} in order to pass authentication to the database. + * @return the connection to the database. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public Connection connect(String url, Properties info) throws SQLException; /** * Gets the driver's major version number. * - * @return the major version number of the Driver - typically starts at 1. + * @return the major version number of the driver - typically starts at 1. + * @since Android 1.0 */ public int getMajorVersion(); /** * Gets the driver's minor version number. * - * @return the minor version number of the Driver - typically starts at 0. + * @return the minor version number of the driver - typically starts at 0. + * @since Android 1.0 */ public int getMinorVersion(); @@ -81,32 +94,42 @@ public interface Driver { * Gets information about possible properties for this driver. * <p> * This method is intended to provide a listing of possible properties that - * the user of the driver may need to supply in order to correct connect to - * a database. Note that the returned array of Properties may change + * the client of the driver must supply in order to establish a connection + * to a database. Note that the returned array of properties may change * depending on the supplied list of property values. + * </p> * * @param url - * the url of the database. A using program may call this method + * the URL of the database. An application may call this method * iteratively as the property list is built up - for example, * when displaying a dialog to an end-user as part of the * database login process. * @param info - * @return an array of DriverPropertyInfo records which provide detail on - * each property that the driver will accept. + * a set of tag/value pairs giving data that a user may be + * prompted to provide in order to connect to the database. + * @return an array of {@code DriverPropertyInfo} records which provide + * details on which additional properties are required (in addition + * to those supplied in the {@code info} parameter) in order to + * connect to the database. * @throws SQLException + * if a database error occurs. + * @since Android 1.0 */ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException; /** * Reports whether this driver is a genuine JDBC CompliantTM driver. The - * driver may only return true from this method if it passes all the JDBC - * Compliance tests. + * driver may only return {@code true} if it passes all the JDBC compliance + * tests. * <p> * A driver may not be fully compliant if the underlying database has * limited functionality. + * </p> * - * @return true if the driver is fully JDBC compliant, false otherwise. + * @return {@code true} if the driver is fully JDBC compliant, {@code false} + * otherwise. + * @since Android 1.0 */ public boolean jdbcCompliant(); diff --git a/sql/src/main/java/java/sql/DriverManager.java b/sql/src/main/java/java/sql/DriverManager.java index 78f362c..afcf2f5 100644 --- a/sql/src/main/java/java/sql/DriverManager.java +++ b/sql/src/main/java/java/sql/DriverManager.java @@ -26,13 +26,19 @@ import java.io.PrintWriter; import java.util.HashSet; import java.util.Vector; import org.apache.harmony.sql.internal.nls.Messages; -import org.apache.harmony.kernel.vm.VM; +// BEGIN android-changed +import dalvik.system.VMStack; +// END android-changed /** - * Provides facilities for managing JDBC Drivers. + * Provides facilities for managing JDBC drivers. * <p> - * The DriverManager class will load JDBC drivers during its initialization, - * from the list of drivers referenced by the System Property "jdbc.drivers". + * The {@code DriverManager} class loads JDBC drivers during its initialization, + * from the list of drivers referenced by the system property {@code + * "jdbc.drivers"}. + * </p> + * + * @since Android 1.0 */ public class DriverManager { @@ -99,28 +105,34 @@ public class DriverManager { } /** - * Removes a driver from the DriverManager's registered driver list. This - * will only succeed where the caller's classloader loaded the driver that - * is to be removed. If the driver was loaded by a different classloader, - * the removal of the driver will fail silently. + * Removes a driver from the {@code DriverManager}'s registered driver list. + * This will only succeed when the caller's class loader loaded the driver + * that is to be removed. If the driver was loaded by a different class + * loader, the removal of the driver fails silently. * <p> - * If the removal succeeds, the DriverManager will not in future use this - * driver when asked to get a Connection. + * If the removal succeeds, the {@code DriverManager} will not use this + * driver in the future when asked to get a {@code Connection}. + * </p> * * @param driver + * the JDBC driver to remove. * @throws SQLException - * if there is an exception accessing the database. + * if there is a problem interfering with accessing the + * database. + * @since Android 1.0 */ public static void deregisterDriver(Driver driver) throws SQLException { if (driver == null) { return; } -// ClassLoader callerClassLoader = VM.callerClassLoader(); //???SQL VM.callerClassLoader not implemented -> null -// -// if (!DriverManager.isClassFromClassLoader(driver, callerClassLoader)) { -// // sql.1=DriverManager: calling class not authorized to deregister JDBC driver -// throw new SecurityException(Messages.getString("sql.1")); //$NON-NLS-1$ -// } // end if + // BEGIN android-changed + ClassLoader callerClassLoader = VMStack.getCallingClassLoader(); + // END android-changed + + if (!DriverManager.isClassFromClassLoader(driver, callerClassLoader)) { + // sql.1=DriverManager: calling class not authorized to deregister JDBC driver + throw new SecurityException(Messages.getString("sql.1")); //$NON-NLS-1$ + } // end if synchronized (theDriverSet) { theDriverSet.remove(driver); } @@ -130,12 +142,13 @@ public class DriverManager { * Attempts to establish a connection to the given database URL. * * @param url - * a URL string representing the database target to connect with - * @return a Connection to the database identified by the URL. null if no - * connection can be made. + * a URL string representing the database target to connect with. + * @return a {@code Connection} to the database identified by the URL. + * {@code null} if no connection can be established. * @throws SQLException * if there is an error while attempting to connect to the - * database identified by the URL + * database identified by the URL. + * @since Android 1.0 */ public static Connection getConnection(String url) throws SQLException { return getConnection(url, new Properties()); @@ -147,17 +160,18 @@ public class DriverManager { * @param url * a URL string representing the database target to connect with * @param info - * a set of Properties to use as arguments to set up the + * a set of properties to use as arguments to set up the * connection. Properties are arbitrary string/value pairs. - * Normally, at least the properties "user" and "password" should - * be passed, with appropriate settings for the userid and its - * corresponding password to get access to the database - * concerned. - * @return a Connection to the database identified by the URL. null if no - * connection can be made. + * Normally, at least the properties {@code "user"} and {@code + * "password"} should be passed, with appropriate settings for + * the user ID and its corresponding password to get access to + * the corresponding database. + * @return a {@code Connection} to the database identified by the URL. + * {@code null} if no connection can be established. * @throws SQLException * if there is an error while attempting to connect to the - * database identified by the URL + * database identified by the URL. + * @since Android 1.0 */ public static Connection getConnection(String url, Properties info) throws SQLException { @@ -190,16 +204,17 @@ public class DriverManager { * Attempts to establish a connection to the given database URL. * * @param url - * a URL string representing the database target to connect with + * a URL string representing the database target to connect with. * @param user - * a userid used to login to the database + * a user ID used to login to the database. * @param password - * a password for the userid to login to the database - * @return a Connection to the database identified by the URL. null if no - * connection can be made. + * a password for the user ID to login to the database. + * @return a {@code Connection} to the database identified by the URL. + * {@code null} if no connection can be established. * @throws SQLException * if there is an error while attempting to connect to the - * database identified by the URL + * database identified by the URL. + * @since Android 1.0 */ public static Connection getConnection(String url, String user, String password) throws SQLException { @@ -217,14 +232,16 @@ public class DriverManager { * Tries to find a driver that can interpret the supplied URL. * * @param url - * the URL of a database - * @return a Driver that can understand the given URL. null if no Driver - * understands the URL + * the URL of a database. + * @return a {@code Driver} that matches the provided URL. {@code null} if + * no {@code Driver} understands the URL * @throws SQLException - * if there is any kind of Database Access problem + * if there is any kind of problem accessing the database. */ public static Driver getDriver(String url) throws SQLException { -// ClassLoader callerClassLoader = VM.callerClassLoader(); //???SQL VM.callerClassLoader not implemented -> null + // BEGIN android-changed + ClassLoader callerClassLoader = VMStack.getCallingClassLoader(); + // END android-changed synchronized (theDriverSet) { /* @@ -236,9 +253,8 @@ public class DriverManager { while (theIterator.hasNext()) { Driver theDriver = theIterator.next(); if (theDriver.acceptsURL(url) -// && DriverManager.isClassFromClassLoader(theDriver, -// callerClassLoader)) { //???SQL VM.callerClassLoader not implemented -> null - ){ + && DriverManager.isClassFromClassLoader(theDriver, + callerClassLoader)) { return theDriver; } } @@ -251,13 +267,17 @@ public class DriverManager { } /** - * Returns an Enumeration that contains all of the loaded JDBC drivers that - * the current caller can access. + * Returns an {@code Enumeration} that contains all of the loaded JDBC + * drivers that the current caller can access. * - * @return An Enumeration containing all the currently loaded JDBC Drivers + * @return An {@code Enumeration} containing all the currently loaded JDBC + * {@code Drivers}. + * @since Android 1.0 */ public static Enumeration<Driver> getDrivers() { -// ClassLoader callerClassLoader = VM.callerClassLoader(); //???SQL VM.callerClassLoader not implemented -> null + // BEGIN android-changed + ClassLoader callerClassLoader = VMStack.getCallingClassLoader(); + // END android-changed /* * Synchronize to avoid clashes with additions and removals of drivers * in the DriverSet @@ -271,28 +291,32 @@ public class DriverManager { Iterator<Driver> theIterator = theDriverSet.iterator(); while (theIterator.hasNext()) { Driver theDriver = theIterator.next(); -// if (DriverManager.isClassFromClassLoader(theDriver, //???SQL VM.callerClassLoader not implemented -> null -// callerClassLoader)) { + if (DriverManager.isClassFromClassLoader(theDriver, + callerClassLoader)) { theVector.add(theDriver); -// } + } } return theVector.elements(); } } /** - * Returns the login timeout when connecting to a database, in seconds. + * Returns the login timeout when connecting to a database in seconds. * - * @return the login timeout in seconds + * @return the login timeout in seconds. + * @since Android 1.0 */ public static int getLoginTimeout() { return loginTimeout; } /** - * @deprecated Gets the log PrintStream used by the DriverManager and all - * the JDBC Drivers. - * @return the PrintStream used for logging activity + * Gets the log {@code PrintStream} used by the {@code DriverManager} and + * all the JDBC Drivers. + * + * @deprecated use {@link #getLogWriter()} instead. + * @return the {@code PrintStream} used for logging activities. + * @since Android 1.0 */ @Deprecated public static PrintStream getLogStream() { @@ -302,8 +326,9 @@ public class DriverManager { /** * Retrieves the log writer. * - * @return A PrintWriter object used as the log writer. null if no log - * writer is set. + * @return A {@code PrintWriter} object used as the log writer. {@code null} + * if no log writer is set. + * @since Android 1.0 */ public static PrintWriter getLogWriter() { return thePrintWriter; @@ -311,10 +336,11 @@ public class DriverManager { /** * Prints a message to the current JDBC log stream. This is either the - * PrintWriter or (deprecated) the PrintStream, if set. + * {@code PrintWriter} or (deprecated) the {@code PrintStream}, if set. * * @param message - * the message to print to the JDBC log stream + * the message to print to the JDBC log stream. + * @since Android 1.0 */ public static void println(String message) { if (thePrintWriter != null) { @@ -332,13 +358,14 @@ public class DriverManager { } /** - * Registers a given JDBC driver with the DriverManager. + * Registers a given JDBC driver with the {@code DriverManager}. * <p> * A newly loaded JDBC driver class should register itself with the - * DriverManager by calling this method. + * {@code DriverManager} by calling this method. + * </p> * * @param driver - * the Driver to register with the DriverManager + * the {@code Driver} to register with the {@code DriverManager}. * @throws SQLException * if a database access error occurs. */ @@ -352,10 +379,11 @@ public class DriverManager { } /** - * Set the login timeout when connecting to a database, in seconds. + * Sets the login timeout when connecting to a database in seconds. * * @param seconds * seconds until timeout. 0 indicates wait forever. + * @since Android 1.0 */ public static void setLoginTimeout(int seconds) { loginTimeout = seconds; @@ -363,12 +391,13 @@ public class DriverManager { } /** - * @deprecated Sets the Print Stream to use for logging data from the - * DriverManager and the JDBC drivers. - * <p> - * Use {@link #setLogWriter} instead. + * Sets the print stream to use for logging data from the {@code + * DriverManager} and the JDBC drivers. + * + * @deprecated Use {@link #setLogWriter} instead. * @param out - * the PrintStream to use for logging. + * the {@code PrintStream} to use for logging. + * @since Android 1.0 */ @Deprecated public static void setLogStream(PrintStream out) { @@ -377,11 +406,12 @@ public class DriverManager { } /** - * Sets the PrintWriter that will be used by all loaded drivers, and also - * the DriverManager. + * Sets the {@code PrintWriter} that is used by all loaded drivers, and also + * the {@code DriverManager}. * * @param out - * the PrintWriter to be used + * the {@code PrintWriter} to be used. + * @since Android 1.0 */ public static void setLogWriter(PrintWriter out) { checkLogSecurity(); @@ -401,14 +431,14 @@ public class DriverManager { } /** - * Finds if a supplied Object belongs to the given ClassLoader. + * Determines whether the supplied object was loaded by the given {@code ClassLoader}. * * @param theObject - * the object to check + * the object to check. * @param theClassLoader - * the ClassLoader - * @return true if the Object does belong to the ClassLoader, false - * otherwise + * the {@code ClassLoader}. + * @return {@code true} if the Object does belong to the {@code ClassLoader} + * , {@code false} otherwise */ private static boolean isClassFromClassLoader(Object theObject, ClassLoader theClassLoader) { diff --git a/sql/src/main/java/java/sql/DriverPropertyInfo.java b/sql/src/main/java/java/sql/DriverPropertyInfo.java index bf261db..3875abb 100644 --- a/sql/src/main/java/java/sql/DriverPropertyInfo.java +++ b/sql/src/main/java/java/sql/DriverPropertyInfo.java @@ -18,49 +18,63 @@ package java.sql; /** - * A class holding information about Driver Properties for making a Connection. - * This class is returned from the <code>Driver.getDriverProperties</code> - * method and is useful in using Connections in an advanced way. + * A class holding information about driver properties of a database connection. + * This class is returned by the + * {@link Driver#getPropertyInfo(String, java.util.Properties)} method and + * allows for the advanced connection handling. + * + * @since Android 1.0 */ public class DriverPropertyInfo { /** * If the value member can be chosen from a set of possible values, they are - * contained here. Otherwise choices is null. + * contained here. Otherwise choices is {@code null}. + * + * @since Android 1.0 */ public String[] choices; /** - * A description of the property. May be null. + * A description of the property. May be {@code null}. + * + * @since Android 1.0 */ public String description; /** * The name of the property. + * + * @since Android 1.0 */ public String name; /** - * True when the value member must be provided during Driver.connect. False - * otherwise. + * {@code True} when the value member must be provided during {@code + * Driver.connect}. {@code False} otherwise. + * + * @since Android 1.0 */ public boolean required; /** - * The current value associated with this property. This is based on the - * data gathered by the getPropertyInfo method, the general Java environment - * and the default values for the driver. + * The current value associated with this property. It is depending on the + * data gathered by the {@code getPropertyInfo} method, the general Java + * environment and the driver's default values. + * + * @since Android 1.0 */ public String value; /** - * Creates a DriverPropertyInfo instance with the supplied name and value. - * Other members take their default values. + * Creates a {@code DriverPropertyInfo} instance with the supplied name and + * value. Other class members take their default values. * * @param name - * The property name + * The property name. * @param value - * The property value + * The property value. + * @since Android 1.0 */ public DriverPropertyInfo(String name, String value) { this.name = name; diff --git a/sql/src/main/java/java/sql/ParameterMetaData.java b/sql/src/main/java/java/sql/ParameterMetaData.java index 7d644d3..94901ae 100644 --- a/sql/src/main/java/java/sql/ParameterMetaData.java +++ b/sql/src/main/java/java/sql/ParameterMetaData.java @@ -19,83 +19,105 @@ package java.sql; /** * An interface used to get information about the types and properties of - * parameters in a PreparedStatement object. + * parameters in a {@code PreparedStatement}. + * + * @since Android 1.0 */ public interface ParameterMetaData { /** - * Indicates that the parameter mode is IN. + * Indicates that the parameter mode is {@code IN}. + * + * @since Android 1.0 */ public static final int parameterModeIn = 1; /** - * Indicates that the parameter mode is INOUT. + * Indicates that the parameter mode is {@code INOUT}. + * + * @since Android 1.0 */ public static final int parameterModeInOut = 2; /** - * Indicates that the parameter mode is OUT. + * Indicates that the parameter mode is {@code OUT}. + * + * @since Android 1.0 */ public static final int parameterModeOut = 4; /** * Indicates that the parameter mode is not known. + * + * @since Android 1.0 */ public static final int parameterModeUnknown = 0; /** - * Indicates that a parameter is not permitted to be NULL. + * Indicates that a parameter is not permitted to be {@code NULL}. + * + * @since Android 1.0 */ public static final int parameterNoNulls = 0; /** - * Indicates that a parameter is permitted to be NULL. + * Indicates that a parameter is permitted to be {@code NULL}. + * + * @since Android 1.0 */ public static final int parameterNullable = 1; /** - * Indicates that whether a parameter is allowed to be null or not is not - * known. + * Indicates that whether a parameter is allowed to be {@code null} or not + * is not known. + * + * @since Android 1.0 */ public static final int parameterNullableUnknown = 2; /** * Gets the fully-qualified name of the Java class which should be passed as - * a parameter to the method <code>PreparedStatement.setObject</code>. + * a parameter to the method {@code PreparedStatement.setObject}. * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 - * @return a String with the fully qualified Java class name of the - * parameter with the specified index. This class name is used for - * custom mapping. + * has index 1. + * @return the fully qualified Java class name of the parameter with the + * specified index. This class name is used for custom mapping + * between SQL types and Java objects. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public String getParameterClassName(int paramIndex) throws SQLException; /** - * Gets the number of parameters in the PreparedStatement for which this - * ParameterMetaData contains information. + * Gets the number of parameters in the {@code PreparedStatement} for which + * this {@code ParameterMetaData} contains information. * - * @return the number of parameters as an int + * @return the number of parameters. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getParameterCount() throws SQLException; /** - * Gets the mode of the specified parameter. + * Gets the mode of the specified parameter. Can be one of: + * <ul> + * <li>ParameterMetaData.parameterModeIn</li> + * <li>ParameterMetaData.parameterModeOut</li> + * <li>ParameterMetaData.parameterModeInOut</li> + * <li>ParameterMetaData.parameterModeUnknown</li> + * </ul> * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 - * @return the parameters mode. Can be: ParameterMetaData.parameterModeIn, - * ParameterMetaData.parameterModeOut, - * ParameterMetaData.parameterModeInOut or - * ParameterMetaData.parameterModeUnknown. + * has index 1. + * @return the parameter's mode. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getParameterMode(int paramIndex) throws SQLException; @@ -104,11 +126,12 @@ public interface ParameterMetaData { * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 - * @return the type of the parameter - an SQL type as defined in - * java.sql.Types. + * has index 1. + * @return the SQL type of the parameter as defined in {@code + * java.sql.Types}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getParameterType(int paramIndex) throws SQLException; @@ -117,12 +140,13 @@ public interface ParameterMetaData { * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 + * has index 1. * @return the type name for the parameter as used by the database. A - * fully-qualified name is returned if the parameter is a User - * Defined Type. + * fully-qualified name is returned if the parameter is a <i>User + * Defined Type</i> (UDT). * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public String getParameterTypeName(int paramIndex) throws SQLException; @@ -131,11 +155,12 @@ public interface ParameterMetaData { * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 + * has index 1. * @return the number of decimal digits ("the precision") for the parameter. - * 0 if the parameter is not a numeric type. + * {@code 0} if the parameter is not a numeric type. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getPrecision(int paramIndex) throws SQLException; @@ -145,26 +170,31 @@ public interface ParameterMetaData { * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 + * has index 1. * @return the number of digits after the decimal point ("the scale") for - * the parameter. 0 if the parameter is not a numeric type. + * the parameter. {@code 0} if the parameter is not a numeric type. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getScale(int paramIndex) throws SQLException; /** - * Gets whether null values are allowed for the specified parameter. + * Gets whether {@code null} values are allowed for the specified parameter. + * The returned value is one of: + * <ul> + * <li>ParameterMetaData.parameterNoNulls</li> + * <li>ParameterMetaData.parameterNullable</li> + * <li>ParameterMetaData.parameterNullableUnknown</li> + * </ul> * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 - * @return indicator of nullability, can be: - * ParameterMetaData.parameterNoNulls, - * ParameterMetaData.parameterNullable, or - * ParameterMetaData.parameterNullableUnknown + * has index 1. + * @return the int code indicating the nullability of the parameter. * @throws SQLException - * if a database error is encountered + * if a database error is encountered. + * @since Android 1.0 */ public int isNullable(int paramIndex) throws SQLException; @@ -173,11 +203,12 @@ public interface ParameterMetaData { * * @param paramIndex * the index number of the parameter, where the first parameter - * has an index of 1 - * @return true if values can be signed numbers for this parameter, false - * otherwise. + * has index 1. + * @return {@code true} if values can be signed numbers for this parameter, + * {@code false} otherwise. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean isSigned(int paramIndex) throws SQLException; } diff --git a/sql/src/main/java/java/sql/PreparedStatement.java b/sql/src/main/java/java/sql/PreparedStatement.java index 5941200..ab81871 100644 --- a/sql/src/main/java/java/sql/PreparedStatement.java +++ b/sql/src/main/java/java/sql/PreparedStatement.java @@ -24,22 +24,27 @@ import java.io.Reader; import java.math.BigDecimal; /** - * An interface for a Precompiled SQL Statement. + * An interface for a precompiled SQL Statement. * <p> - * An SQL Statement is put into a PreparedStatement and is precompiled so that - * it can be executed multiple times efficiently. + * An SQL Statement is put into a {@code PreparedStatement} and is precompiled + * so that it can be executed efficiently multiple times. + * </p> * <p> - * Setter methods are supplied in the PreparedStatement interface for the - * setting of IN parameters for the Statement. The setter method used for each - * IN parameter must match the type of the IN parameter being set. + * Setter methods are supplied in the {@code PreparedStatement} interface for + * the setting of {@code IN} parameters for the statement. The setter method + * used for each {@code IN} parameter must match the parameter's type. + * </p> + * + * @since Android 1.0 */ public interface PreparedStatement extends Statement { /** - * Add a set of parameters to the PreparedStatement's command batch. + * Add a set of parameters to the {@code PreparedStatement}'s command batch. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void addBatch() throws SQLException; @@ -47,365 +52,430 @@ public interface PreparedStatement extends Statement { * Clear the current parameter values. * <p> * Typically, parameter values are retained for multiple executions of the - * Statement. Setting a parameter value replaces the previous value. This + * {@code Statement}. Setting a parameter value replaces the previous value. This * method clears the values for all parameters, releasing all resources used * by those parameters. + * </p> * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void clearParameters() throws SQLException; /** - * Executes the SQL statement in this PreparedStatement. + * Executes the SQL statement in this {@code PreparedStatement}. * <p> - * A PreparedStatement may return multiple results. The execute method - * returns a flag indicating the kind of result produced by - * PreparedStatement. The methods <code> - * getResultSet</code> or - * <code>getUpdateCount</code> are used to retrieve the first result, - * while <code>getMoreResults</code> must be used to retrieve the second - * and subsequent results. + * A {@code PreparedStatement} may return multiple results. The execute + * method executes the {@code PreparedStatement} and returns a flag + * indicating the kind of result produced by the action. The methods + * {@code getResultSet} or {@code getUpdateCount} are used to retrieve + * the first result, and the second and subsequent results are + * retrieved with {@code getMoreResults}. + * </p> * - * @return true if the result of the execution is a ResultSet, false if - * there is no result or if the result is an update count. + * @return {@code true} if the result of the execution is a {@code + * ResultSet}, {@code false} if there is no result or if the result + * is an update count. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean execute() throws SQLException; /** - * Execute the SQL query in the PreparedStatement and return the ResultSet - * generated by the query. + * Executes the SQL query in the {@code PreparedStatement} and returns the + * {@code ResultSet} generated by the query. * - * @return the ResultSet generated by the query - never null. + * @return the {@code ResultSet} generated by the query, never {@code null}. * @throws SQLException * if a database error happens or if the SQL statement does not - * produce a ResultSet. + * produce a {@code ResultSet}. + * @since Android 1.0 */ public ResultSet executeQuery() throws SQLException; /** - * Invoke the SQL command contained within the Prepared Statement. This must - * be INSERT, UPDATE, DELETE, or a command that returns nothing. + * Invokes the SQL command contained within the prepared statement. This + * must be {@code INSERT}, {@code UPDATE}, {@code DELETE}, or a command that + * returns nothing. * - * @return the count of rows for INSERT, UPDATE or DELETE statements, 0 for - * statements that return nothing + * @return the number of affected rows for {@code INSERT}, {@code UPDATE} or {@code + * DELETE} statements, {@code 0} for statements that return nothing. * @throws SQLException * if a database error happens or if the SQL statement returns a - * ResultSet. + * {@code ResultSet}. + * @since Android 1.0 */ public int executeUpdate() throws SQLException; /** - * Returns a ResultSetMetaData containing data from the ResultSet that is - * produced when the PreparedStatement is invoked. + * Returns a {@code ResultSetMetaData} describing the {@code + * ResultSet} that would be produced by execution of the {@code PreparedStatement}. * <p> - * It is possible to know the Metadata for the ResultSet without executing - * the PreparedStatement, because the PreparedStatement is precompiled. As a - * result the Metadata can be queried ahead of time without actually - * executing the statement. + * It is possible to know the metadata for the {@code ResultSet} without + * executing the {@code PreparedStatement}, because the {@code + * PreparedStatement} is precompiled. As a result the metadata can be + * queried ahead of time without actually executing the statement. + * </p> * - * @return a ResultSetMetaData object with the information about the columns - * of the ResultSet, if the driver can return a ResultSetMetaData. - * null otherwise. + * @return a {@code ResultSetMetaData} object with the information about the + * columns of the {@code ResultSet}, if the driver can return a + * {@code ResultSetMetaData}. {@code null} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public ResultSetMetaData getMetaData() throws SQLException; /** - * Gets information about the parameters of the PreparedStatement. + * Gets information about the parameters of the {@code PreparedStatement}. * - * @return a ParameterMetaData object which holds information about the - * number, type and properties of the parameters of this - * PreparedStatement. + * @return a {@code ParameterMetaData} object which holds information about + * the number, type, and properties of the parameters of this {@code + * PreparedStatement}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public ParameterMetaData getParameterMetaData() throws SQLException; /** - * Sets the value of a specified parameter to the supplied Array object. + * Sets the value of a specified parameter to the supplied {@code Array}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theArray - * a java.sql.Array holing the data to set. + * a {@code java.sql.Array} giving the new value of the parameter at {@code + * parameterIndex}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Array + * @since Android 1.0 */ public void setArray(int parameterIndex, Array theArray) throws SQLException; /** * Sets the value of a specified parameter to the content of a supplied - * InputStream, which has a specified number of bytes. + * {@code InputStream}, which has a specified number of bytes. * <p> - * This is a good method for setting an SQL LONVARCHAR parameter where the - * length of the data is large. Data is read from the InputStream until - * end-of-file is reached or the specified number of bytes is copied. + * This is a good method for setting an SQL {@code LONVARCHAR} parameter + * where the length of the data is large. Data is read from the {@code + * InputStream} until end-of-file is reached or the specified number of + * bytes is copied. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theInputStream - * the ASCII InputStream carrying the data to update the - * parameter + * the ASCII {@code InputStream} carrying the data to which the + * parameter at {@code parameterIndex} is set. * @param length - * the number of bytes in the InputStream to copy to the - * parameter + * the number of bytes in the {@code InputStream} to copy to the + * parameter. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setAsciiStream(int parameterIndex, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of a specified parameter to a supplied - * java.math.BigDecimal value. + * Sets the value of a specified parameter to a supplied {@code + * java.math.BigDecimal} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theBigDecimal - * the java.math.BigInteger value to set + * the value to which the parameter at {@code parameterIndex} is + * set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see java.math.BigDecimal + * @since Android 1.0 */ public void setBigDecimal(int parameterIndex, BigDecimal theBigDecimal) throws SQLException; /** * Sets the value of a specified parameter to the content of a supplied - * binary InputStream, which has a specified number of bytes. + * binary {@code InputStream}, which has a specified number of bytes. * <p> * Use this method when a large amount of data needs to be set into a - * LONGVARBINARY parameter. + * {@code LONGVARBINARY} parameter. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theInputStream - * the binary InputStream carrying the data to update the - * parameter + * the binary {@code InputStream} carrying the data to update the + * parameter. * @param length - * the number of bytes in the InputStream to copy to the - * parameter + * the number of bytes in the {@code InputStream} to copy to the + * parameter. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setBinaryStream(int parameterIndex, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of a specified parameter to the given Blob object. + * Sets the value of a specified parameter to the given {@code Blob} object. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theBlob - * a java.sql.Blob holding the data to update the parameter + * the {@code java.sql.Blob} to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 + * @see Blob */ public void setBlob(int parameterIndex, Blob theBlob) throws SQLException; /** - * Sets the value of a specified parameter to a supplied boolean value. + * Sets the value of a specified parameter to a supplied {@code boolean} + * value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theBoolean - * the boolean value to update the parameter + * the boolean value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setBoolean(int parameterIndex, boolean theBoolean) throws SQLException; /** - * Sets the value of a specified parameter to a supplied byte value. + * Sets the value of a specified parameter to a supplied {@code byte} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theByte - * the byte value to update the parameter + * the byte value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setByte(int parameterIndex, byte theByte) throws SQLException; /** * Sets the value of a specified parameter to a supplied array of bytes. The - * array is mapped to a VARBINARY or LONGVARBINARY in the database. + * array is mapped to a {@code VARBINARY} or {@code LONGVARBINARY} in the + * database. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theBytes - * the array of bytes to update the parameter + * the array of bytes to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setBytes(int parameterIndex, byte[] theBytes) throws SQLException; /** * Sets the value of a specified parameter to the character content of a - * Reader object, with the specified length of character data. + * {@code Reader} object, with the specified length of character data. + * <p> + * Data is read from the {@code + * Reader} until end-of-file is reached or the specified number of + * characters are copied. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has * index 1 * @param reader - * the java.io.Reader encompassing the character data + * the {@code java.io.Reader} containing the character data. * @param length - * the amount of characters to be read + * the number of characters to be read. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException; /** - * Sets the value of a specified parameter to the given Clob object. + * Sets the value of a specified parameter to the given {@code Clob} object. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theClob - * a java.sql.Clob holding the data to update the parameter + * a {@code java.sql.Clob} holding the data to which the + * parameter at {@code parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setClob(int parameterIndex, Clob theClob) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Date - * value. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Date} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theDate - * a java.sql.Date to update the parameter + * a {@code java.sql.Date} to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setDate(int parameterIndex, Date theDate) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Date - * value, using a supplied Calendar to map the Date. The Calendar allows the - * application to control the timezone used to compute the SQL DATE in the - * database - without the supplied Calendar, the driver uses the default - * timezone of the Java virtual machine. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Date} value, using a supplied {@code Calendar} to map the Date. + * The {@code Calendar} allows the application to control the timezone used + * to compute the SQL {@code DATE} in the database - without the supplied + * {@code Calendar}, the driver uses the default timezone of the Java + * virtual machine. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theDate - * a java.sql.Date to update the parameter + * a {@code java.sql.Date} to which the parameter at {@code + * parameterIndex} is set. * @param cal - * a Calendar to use to construct the SQL DATE value + * a {@code Calendar} to use to construct the SQL {@code DATE} + * value. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Date + * @see java.util.Calendar + * @since Android 1.0 */ public void setDate(int parameterIndex, Date theDate, Calendar cal) throws SQLException; /** - * Sets the value of a specified parameter to a supplied double value. + * Sets the value of a specified parameter to a supplied {@code double} + * value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theDouble - * the double value to update the parameter + * the {@code double} value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setDouble(int parameterIndex, double theDouble) throws SQLException; /** - * Sets the value of a specified parameter to to a supplied float value. + * Sets the value of a specified parameter to to a supplied {@code float} + * value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theFloat - * the float value to update the parameter + * the {@code float} value to update the parameter. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setFloat(int parameterIndex, float theFloat) throws SQLException; /** - * Sets the value of a specified parameter to a supplied int value. + * Sets the value of a specified parameter to a supplied {@code int} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theInt - * the int value to update the parameter + * the {@code int} value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setInt(int parameterIndex, int theInt) throws SQLException; /** - * Sets the value of a specified parameter to a supplied long value. + * Sets the value of a specified parameter to a supplied {@code long} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theLong - * the long value to update the parameter + * the {@code long} value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setLong(int parameterIndex, long theLong) throws SQLException; /** - * Sets the value of a specified parameter to SQL NULL. Don't use this - * version of setNull for User Defined Types or for REF type parameters. + * Sets the value of a specified parameter to SQL {@code NULL}. Don't use + * this version of {@code setNull} for <i>User Defined Types</i> (UDT) or + * for REF type parameters. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param sqlType - * the SQL Type of the parameter, as defined in java.sql.Types + * the SQL type of the parameter, as defined in {@code + * java.sql.Types}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setNull(int parameterIndex, int sqlType) throws SQLException; /** - * Sets the value of a specified parameter to SQL NULL. This version of - * setNull should be used for User Defined Types (UDTs) and also REF types. - * UDTs can be STRUCT, DISTINCT, JAVA_OBJECT and named array types. + * Sets the value of a specified parameter to SQL {@code NULL}. This version + * of {@code setNull} should be used for <i>User Defined Types</i> (UDTs) + * and also REF types. UDTs can be {@code STRUCT}, {@code DISTINCT}, {@code + * JAVA_OBJECT} and named array types. * <p> - * Applications must provide the SQL Type code and also a fully qualified - * SQL Type name when supplying a NULL UDT or REF. For a UDT, the type name - * is the type name of the parameter itself, but for a REF parameter the - * type name is the type name of the referenced type. + * Applications must provide the SQL type code and also a fully qualified + * SQL type name when supplying a {@code NULL} UDT or REF. For a UDT, the + * type name is the type name of the parameter itself, but for a REF + * parameter the type name is the type name of the referenced type. + * </p> * * @param paramIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param sqlType - * the SQL Type of the parameter, as defined in java.sql.Types + * the SQL type of the parameter, as defined in {@code + * java.sql.Types}. * @param typeName * the fully qualified name of a UDT or REF type - ignored if the * parameter is not a UDT. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Types + * @since Android 1.0 */ public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException; @@ -415,21 +485,25 @@ public interface PreparedStatement extends Statement { * <p> * There is a standard mapping from Java types to SQL types, defined in the * JDBC specification. The passed object is then transformed into the - * appropriate SQL type, and then transferred to the database. setObject can - * be used to pass abstract data types unique to the database, by using a - * JDBC driver specific Java type. If the object's class implements the - * interface SQLData, the JDBC driver calls <code>SQLData.writeSQL</code> - * to write it to the SQL data stream. If the object's class implements Ref, - * Blob, Clob, Struct, or Array, the driver passes it to the database as a - * value of the corresponding SQL type. + * appropriate SQL type, and then transferred to the database. {@code + * setObject} can be used to pass abstract data types unique to the + * database, by using a JDBC driver specific Java type. If the object's + * class implements the interface {@code SQLData}, the JDBC driver calls + * {@code SQLData.writeSQL} to write it to the SQL data stream. If the + * object's class implements {@code Ref}, {@code Blob}, {@code Clob}, + * {@code Struct}, or {@code Array}, the driver passes it to the database as + * a value of the corresponding SQL type. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theObject - * the Object containing the value to update the parameter + * the object containing the value to which the parameter at + * {@code parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject) throws SQLException; @@ -437,22 +511,26 @@ public interface PreparedStatement extends Statement { /** * Sets the value of a specified parameter using a supplied object. * <p> - * The Object is converted to the given targetSqlType before it is sent to - * the database. If the object has a custom mapping (its class implements - * the interface SQLData), the JDBC driver will call the method - * SQLData.writeSQL to write it to the SQL data stream. If the object's - * class implements Ref, Blob, Clob, Struct, or Array, the driver will pass - * it to the database in the form of the relevant SQL type. + * The object is converted to the given {@code targetSqlType} before it is + * sent to the database. If the object has a custom mapping (its class + * implements the interface {@code SQLData}), the JDBC driver will call the method + * {@code SQLData.writeSQL} to write it to the SQL data stream. If the + * object's class implements {@code Ref}, {@code Blob}, {@code Clob}, + * {@code Struct}, or {@code Array}, the driver will pass it to the database + * in the form of the relevant SQL type. + * </p> * * @param parameterIndex - * the parameter index, where the first parameter has index 1 + * the parameter index, where the first parameter has index 1. * @param theObject - * the Object containing the value to update the parameter + * the Object containing the value to which the parameter at + * {@code parameterIndex} is set. * @param targetSqlType - * the SQL Type to send to the database, as defined in - * java.sql.Types + * the SQL type to send to the database, as defined in {@code + * java.sql.Types}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject, int targetSqlType) throws SQLException; @@ -460,103 +538,123 @@ public interface PreparedStatement extends Statement { /** * Sets the value of a specified parameter using a supplied object. * <p> - * The Object is converted to the given targetSqlType before it is sent to - * the database. If the object has a custom mapping (its class implements - * the interface SQLData), the JDBC driver will call the method - * SQLData.writeSQL to write it to the SQL data stream. If the object's - * class implements Ref, Blob, Clob, Struct, or Array, the driver will pass - * it to the database in the form of the relevant SQL type. + * The object is converted to the given {@code targetSqlType} before it is + * sent to the database. If the object has a custom mapping (its class + * implements the interface {@code SQLData}), the JDBC driver will call the method + * {@code SQLData.writeSQL} to write it to the SQL data stream. If the + * object's class implements {@code Ref}, {@code Blob}, {@code Clob}, + * {@code Struct}, or {@code Array}, the driver will pass it to the database + * in the form of the relevant SQL type. + * </p> * * @param parameterIndex - * the parameter index, where the first parameter has index 1 + * the parameter index, where the first parameter has index 1. * @param theObject - * the Object containing the value to update the parameter + * the Object containing the value to which the parameter at + * {@code parameterIndex} is set. * @param targetSqlType - * the SQL Type to send to the database, as defined in - * java.sql.Types + * the SQL type to send to the database, as defined in {@code + * java.sql.Types}. * @param scale * the number of digits after the decimal point - only applies to - * the types java.sql.Types.DECIMAL and java.sql.Types.NUMERIC - - * ignored for all other types. + * the types {@code java.sql.Types.DECIMAL} and {@code + * java.sql.Types.NUMERIC} - ignored for all other types. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) throws SQLException; /** - * Sets the value of a specified parameter to a supplied REF(<structured-type>) - * value. This is stored as an SQL REF. + * Sets the value of a specified parameter to a supplied {@code + * REF(<structured-type>)} value. This is stored as an SQL {@code REF}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theRef - * a java.sql.Ref value to update the parameter + * a {@code java.sql.Ref} value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Ref + * @since Android 1.0 */ public void setRef(int parameterIndex, Ref theRef) throws SQLException; /** - * Sets the value of a specified parameter to a supplied short value. + * Sets the value of a specified parameter to a supplied {@code short} + * value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theShort - * a short value to update the parameter + * a {@code short} value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setShort(int parameterIndex, short theShort) throws SQLException; /** - * Sets the value of a specified parameter to a supplied String. + * Sets the value of a specified parameter to a supplied string. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theString - * a String value to update the parameter + * the value to which the parameter at {@code parameterIndex} is + * set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setString(int parameterIndex, String theString) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Time - * value. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Time} value. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theTime - * a java.sql.Time value to update the parameter + * a {@code java.sql.Time} value to which the parameter at + * {@code parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setTime(int parameterIndex, Time theTime) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Time - * value, using a supplied Calendar. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Time} value, using a supplied {@code Calendar}. * <p> - * The driver uses the supplied Calendar to create the SQL TIME value, which - * allows it to use a custom timezone - otherwise the driver uses the - * default timezone of the Java virtual machine. + * The driver uses the supplied {@code Calendar} to create the SQL {@code + * TIME} value, which allows it to use a custom timezone - otherwise the + * driver uses the default timezone of the Java virtual machine. + * </p> * * @param parameterIndex - * the parameter number index, where the first parameter has - * index 1 + * the parameter number index, where the first parameter has + * index 1. * @param theTime - * a java.sql.Time value to update the parameter + * a {@code java.sql.Time} value to which the parameter at + * {@code parameterIndex} is set. * @param cal - * a Calendar to use to construct the SQL TIME value + * a {@code Calendar} to use to construct the SQL {@code TIME} + * value. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Time + * @see java.util.Calendar + * @since Android 1.0 */ public void setTime(int parameterIndex, Time theTime, Calendar cal) throws SQLException; @@ -567,65 +665,78 @@ public interface PreparedStatement extends Statement { * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theTimestamp - * the java.sql.Timestamp value to update the parameter + * the java.sql.Timestamp value to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setTimestamp(int parameterIndex, Timestamp theTimestamp) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.sql.Timestamp - * value, using the supplied Calendar. + * Sets the value of a specified parameter to a supplied {@code + * java.sql.Timestamp} value, using the supplied {@code Calendar}. * <p> - * The driver uses the supplied Calendar to create the SQL TIMESTAMP value, - * which allows it to use a custom timezone - otherwise the driver uses the - * default timezone of the Java virtual machine. + * The driver uses the supplied {@code Calendar} to create the SQL {@code + * TIMESTAMP} value, which allows it to use a custom timezone - otherwise + * the driver uses the default timezone of the Java virtual machine. + * </p> * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theTimestamp - * the java.sql.Timestamp value to update the parameter + * the {@code java.sql.Timestamp} value to which the parameter at + * {@code parameterIndex} is set. * @param cal - * a Calendar to use to construct the SQL TIMESTAMP value + * a {@code Calendar} to use to construct the SQL {@code + * TIMESTAMP} value * @throws SQLException - * if a database error happens + * if a database error happens. + * @see Timestamp + * @see java.util.Calendar + * @since Android 1.0 */ public void setTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar cal) throws SQLException; /** - * @deprecated Sets the value of a specified parameter to the characters - * from a supplied InputStream, with a specified number of - * bytes. + * Sets the value of a specified parameter to the characters from a supplied + * {@code InputStream}, with a specified number of bytes. + * + * @deprecated Use {@link #setCharacterStream(int, Reader, int)} * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theInputStream - * the InputStream with the character data to update the - * parameter + * the {@code InputStream} with the character data to which the + * parameter at {@code parameterIndex} is set. * @param length - * the number of bytes to read from the InputStream + * the number of bytes to read from the {@code InputStream}. * @throws SQLException - * if a database error happens + * if a database error happens. */ @Deprecated public void setUnicodeStream(int parameterIndex, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of a specified parameter to a supplied java.net.URL. + * Sets the value of a specified parameter to a supplied {@code + * java.net.URL}. * * @param parameterIndex * the parameter number index, where the first parameter has - * index 1 + * index 1. * @param theURL - * the URL to update the parameter + * the {@code URL} to which the parameter at {@code + * parameterIndex} is set. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see URL + * @since Android 1.0 */ public void setURL(int parameterIndex, URL theURL) throws SQLException; } diff --git a/sql/src/main/java/java/sql/Ref.java b/sql/src/main/java/java/sql/Ref.java index cc0adf4..2ceac8b 100644 --- a/sql/src/main/java/java/sql/Ref.java +++ b/sql/src/main/java/java/sql/Ref.java @@ -20,35 +20,42 @@ package java.sql; import java.util.Map; /** - * A manifestation of the SQL REF type - a reference to an SQL type contained in - * the database. + * This interface represents an SQL Ref - a data object containing a cursor + * or pointer to a result table. * <p> - * The SQL REF's are held in a table along with SQL structured types. Every REF - * has an individual identifier for each single instance. The SQL REF is used - * instead of the structured type it references. - * <p> - * A Ref object is stored into the database using the PreparedStatement.setRef - * method. + * The data structure identified by an instance of Ref is held in the + * database, so the data is not necessarily read and converted + * into a Java object until {@code getObject} is called. However, if + * the database supports the {@code Ref} type, it is not typically + * necessary to get the underlying object before using it in a method call - + * the {@code Ref} object can be used in place of the data structure. + * </p> + * A {@code Ref} object is stored into the database using the + * {@link PreparedStatement#setRef(int, Ref)} method. + * + * @since Android 1.0 */ public interface Ref { /** * Gets the fully-qualified SQL name of the SQL structured type that this - * Ref references. + * {@code Ref} references. * - * @return the fully qualified name of the SQL structured type + * @return the fully qualified name of the SQL structured type. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getBaseTypeName() throws SQLException; /** - * Gets the SQL structured type instance referenced by this Ref. + * Gets the SQL structured type instance referenced by this {@code Ref}. * * @return a Java object whose type is defined by the mapping for the SQL * structured type. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public Object getObject() throws SQLException; @@ -57,23 +64,25 @@ public interface Ref { * to a Java type. * * @param map - * a java.util.Map which contains the mapping to use + * the mapping for type conversion. * @return a Java object whose type is defined by the mapping for the SQL * structured type. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public Object getObject(Map<String, Class<?>> map) throws SQLException; /** - * Sets the value of the structured typethat this Ref references to a - * supplied Object. + * Sets the value of the structured type that this {@code Ref} references to + * a supplied object. * * @param value - * the Object representing the new SQL structured type that this - * Ref will reference. + * the {@code Object} representing the new SQL structured type + * that this {@code Ref} references. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public void setObject(Object value) throws SQLException; } diff --git a/sql/src/main/java/java/sql/ResultSet.java b/sql/src/main/java/java/sql/ResultSet.java index dd2334e..f33f9de 100644 --- a/sql/src/main/java/java/sql/ResultSet.java +++ b/sql/src/main/java/java/sql/ResultSet.java @@ -25,1188 +25,1363 @@ import java.util.Map; import java.net.URL; /** - * An interface to an Object which represents a Table of Data, typically - * returned as the result of a Query to a Database. + * An interface for an object which represents a database table entry, returned + * as the result of the query to the database. * <p> - * <code>ResultSets</code> have a Cursor which points to a current row of - * data. When a ResultSet is created, the Cursor is positioned before the first - * row. To move the Cursor to the next row in the table, use the - * <code>next</code> method. The next method returns true until there are no - * more rows in the ResultSet, when it returns false. + * {@code ResultSet}s have a cursor which points to the current data table row. + * When the {@code ResultSet} is created, the cursor's location is one position + * ahead of the first row. To move the cursor to the first and consecutive rows, + * use the {@code next} method. The {@code next} method returns {@code true} as + * long as there are more rows in the {@code ResultSet}, otherwise it returns + * {@code false}. + * </p> * <p> - * The default type of ResultSet cannot be updated and its cursor can only move - * forward through the rows of data. This means that it is only possible to read - * through it once. However, it is possible to create types of ResultSet that - * can be updated and also types where the cursor can be scrolled forward and - * backward through the rows of data. This is shown in the following code - * example: <code> - * Connection con; - * Statement aStatement = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, - * ResultSet.CONCUR_UPDATABLE ); - * ResultSet theResultSet = theStatement.executeQuery("SELECT price, quantity FROM STOCKTABLE"); - * // theResultSet will be both scrollable and updateable - * </code> + * The default type of {@code ResultSet} can not be updated and its cursor can + * only advance forward through the rows of data. This means that it is only + * possible to read through it once. However, other kinds of {@code ResultSet} + * are implemented: an <i>updatable</i> type and also types where the cursor can + * be <i>scrolled</i> forward and backward through the rows of data. How such a + * {@code ResultSet} is created is demonstrated in the following example: + * </p> + * <ul> + * <dd> + * {@code Connection con;}</dd> + * <dd>{@code Statement aStatement = con.createStatement( + * ResultSet.TYPE_SCROLL_SENSITIVE,}{@code ResultSet.CONCUR_UPDATABLE );}</dd> + * <dd>{@code ResultSet theResultSet = + * theStatement.executeQuery("SELECT price, quantity FROM STOCKTABLE");}</dd> + * <dd>{@code // theResultSet is both scrollable and updatable}</dd> </ul> * <p> - * The ResultSet interface provides a series of methods for retrieving data from - * columns in the current row, such as getDate, getFloat. The columns are - * identified either by their index number (starting at 1) or by their name - - * there are separate methods for both techniques of column addressing. The - * column names are case insensitive. If several columns have the same name, - * then the getter methods use the first matching column. This means that if - * column names are used, it is not possible to guarantee that the name will - * retrieve data from the intended column - for certainty it is better to use - * column indexes. Ideally the columns should be read left-to-right and read - * once only, since not all * databases are optimized to handle other techniques - * of reading the data. + * The {@code ResultSet} interface provides a series of methods for retrieving + * data from columns in the current row, such as {@code getDate} and {@code + * getFloat}. The columns are retrieved either by their index number (starting + * at 1) or by their name - there are separate methods for both techniques of + * column addressing. The column names are case insensitive. If several columns + * have the same name, then the getter methods use the first matching column. + * This means that if column names are used, it is not possible to guarantee + * that the name will retrieve data from the intended column - for certainty it + * is better to use column indexes. Ideally the columns should be read + * left-to-right and read once only, since not all databases are optimized to + * handle other techniques of reading the data. + * </p> * <p> - * When reading data, the JDBC driver maps the SQL data retrieved from the - * database to the Java type implied by the method invoked by the application. - * The JDBC specification has a table of allowable mappings from SQL types to - * Java types. + * When reading data via the appropriate getter methods, the JDBC driver maps + * the SQL data retrieved from the database to the Java type implied by the + * method invoked by the application. The JDBC specification has a table for the + * mappings from SQL types to Java types. + * </p> * <p> - * There are also methods for writing data into the ResultSet, such as - * updateInt, updateString. The update methods can be used either to modify the - * data of an existing row or to insert new data rows into the ResultSet. - * Modification of existing data involves moving the Cursor to the row which - * needs modification and then using the update methods to modify the data, - * followed by calling the ResultSet.updateRow method. For insertion of new - * rows, the cursor is first moved to a special row called the Insert Row, data - * is added using the update methods, followed by calling the - * ResultSet.insertRow method. + * There are also methods for writing data into the {@code ResultSet}, such as + * {@code updateInt} and {@code updateString}. The update methods can be used + * either to modify the data of an existing row or to insert new data rows into + * the {@code ResultSet} . Modification of existing data involves moving the + * cursor to the row which needs modification and then using the update methods + * to modify the data, followed by calling the {@code ResultSet.updateRow} + * method. For insertion of new rows, the cursor is first moved to a special row + * called the <i>Insert Row</i>, data is added using the update methods, + * followed by calling the {@code ResultSet.insertRow} method. + * </p> * <p> - * A ResultSet is closed if the Statement object which generated it closed, - * executed again or is used to retrieve the next result from a sequence of - * results. + * A {@code ResultSet} is closed if the statement which generated it closes, the + * statement is executed again, or the same statement's next {@code ResultSet} + * is retrieved (if the statement returned of multiple results). + * </p> * + * @since Android 1.0 */ public interface ResultSet { /** - * A constant used to indicate that a ResultSet object must be closed when - * the method Connection.commit is invoked. + * A constant used to indicate that a {@code ResultSet} object must be + * closed when the method {@code Connection.commit} is invoked. + * + * @since Android 1.0 */ public static final int CLOSE_CURSORS_AT_COMMIT = 2; /** - * A constant used to indicate that a ResultSet object must not be closed - * when the method Connection.commit is invoked. + * A constant used to indicate that a {@code ResultSet} object must not be + * closed when the method {@code Connection.commit} is invoked. + * + * @since Android 1.0 */ public static final int HOLD_CURSORS_OVER_COMMIT = 1; /** - * A constant used to indicate the Concurrency Mode for a ResultSet object - * that cannot be updated. + * A constant used to indicate the concurrency mode for a {@code ResultSet} + * object that cannot be updated. + * + * @since Android 1.0 */ public static final int CONCUR_READ_ONLY = 1007; /** - * A constant used to indicate the Concurrency Mode for a ResultSet object - * that can be updated. + * A constant used to indicate the concurrency mode for a {@code ResultSet} + * object that can be updated. + * + * @since Android 1.0 */ public static final int CONCUR_UPDATABLE = 1008; /** - * A constant used to indicate processing of the rows of a ResultSet in the - * forward direction, first to last + * A constant used to indicate processing of the rows of a {@code ResultSet} + * in the forward direction, first to last. + * + * @since Android 1.0 */ public static final int FETCH_FORWARD = 1000; /** - * A constant used to indicate processing of the rows of a ResultSet in the - * reverse direction, last to first + * A constant used to indicate processing of the rows of a {@code ResultSet} + * in the reverse direction, last to first. + * + * @since Android 1.0 */ public static final int FETCH_REVERSE = 1001; /** * A constant used to indicate that the order of processing of the rows of a - * ResultSet is unknown. + * {@code ResultSet} is unknown. + * + * @since Android 1.0 */ public static final int FETCH_UNKNOWN = 1002; /** - * A constant used to indicate a ResultSet object whose Cursor can only move - * forward + * A constant used to indicate a {@code ResultSet} object whose cursor can + * only move forward. + * + * @since Android 1.0 */ public static final int TYPE_FORWARD_ONLY = 1003; /** - * A constant used to indicate a ResultSet object which is Scrollable but - * which is not sensitive to changes made by others + * A constant used to indicate a {@code ResultSet} object which is + * scrollable but is insensitive to changes made by others. + * + * @since Android 1.0 */ public static final int TYPE_SCROLL_INSENSITIVE = 1004; /** - * A constant used to indicate a ResultSet object which is Scrollable but - * which is sensitive to changes made by others + * A constant used to indicate a {@code ResultSet} object which is + * scrollable and sensitive to changes made by others. + * + * @since Android 1.0 */ public static final int TYPE_SCROLL_SENSITIVE = 1005; /** - * Moves the Cursor to a specified row number in the ResultSet. + * Moves the cursor to a specified row number in the {@code ResultSet}. * * @param row - * The new row number for the Cursor - * @return true if the new Cursor position is on the ResultSet, false - * otherwise + * the index of the row starting at index 1. Index {@code -1} + * returns the last row. + * @return {@code true} if the new cursor position is on the {@code + * ResultSet}, {@code false} otherwise. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean absolute(int row) throws SQLException; /** - * Moves the Cursor to the end of the ResultSet, after the last row. + * Moves the cursor to the end of the {@code ResultSet}, after the last row. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void afterLast() throws SQLException; /** - * Moves the Cursor to the start of the ResultSet, before the first row. + * Moves the cursor to the start of the {@code ResultSet}, before the first + * row. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void beforeFirst() throws SQLException; /** - * Cancels any updates made to the current row in the ResultSet. + * Cancels any updates made to the current row in the {@code ResultSet}. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void cancelRowUpdates() throws SQLException; /** - * Clears all the warnings related to this ResultSet. + * Clears all warnings related to this {@code ResultSet}. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void clearWarnings() throws SQLException; /** - * Releases this ResultSet's database and JDBC resources. You are strongly - * advised to use this method rather than relying on the release being done - * when the ResultSet's finalize method is called during garbage collection - * process. Note that the close() method might take some time to complete - * since it is dependent on the behaviour of the connection to the database - * and the database itself. + * Releases this {@code ResultSet}'s database and JDBC resources. You are + * strongly advised to use this method rather than relying on the release + * being done when the {@code ResultSet}'s finalize method is called during + * garbage collection process. Note that the {@code close()} method might + * take some time to complete since it is dependent on the behavior of the + * connection to the database and the database itself. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void close() throws SQLException; /** - * Deletes the current row from the ResultSet and from the underlying - * database. + * Deletes the current row from the {@code ResultSet} and from the + * underlying database. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void deleteRow() throws SQLException; /** - * Gets the index number for a column in the ResultSet from the provided - * Column Name. + * Gets the index number for a column in the {@code ResultSet} from the + * provided column name. * * @param columnName - * the column name - * @return the index of the column in the ResultSet for the column name + * the column name. + * @return the column's index in the {@code ResultSet} identified by column + * name. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int findColumn(String columnName) throws SQLException; /** - * Shifts the cursor position to the first row in the ResultSet. + * Shifts the cursor position to the first row in the {@code ResultSet}. * - * @return true if the position is in a legitimate row, false if the - * ResultSet contains no rows. + * @return {@code true} if the position is in a legitimate row, {@code + * false} if the {@code ResultSet} contains no rows. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean first() throws SQLException; /** - * Gets the content of a column specified as a column index in the current - * row of this ResultSet as a java.sql.Array. + * Gets the content of a column specified by column index in the current row + * of this {@code ResultSet} as a {@code java.sql.Array}. * * @param columnIndex * the index of the column to read - * @return a java.sql.Array with the data from the column + * @return a {@code java.sql.Array} with the data from the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Array getArray(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a - * java.sql.Array. + * Gets the value of a column specified by column name as a {@code + * java.sql.Array}. * * @param colName - * the name of the column to read - * @return a java.sql.Array with the data from the column + * the name of the column to read. + * @return a {@code java.sql.Array} with the data from the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Array getArray(String colName) throws SQLException; /** - * Gets the value of a column specified as a column index as an ASCII + * Gets the value of a column specified by column index as an ASCII * character stream. * * @param columnIndex - * the index of the column to read - * @return an InputStream with the data from the column + * the index of the column to read. + * @return an {@code InputStream} with the data from the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public InputStream getAsciiStream(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as an ASCII - * character stream. + * Gets the value of a column specified by column name as an ASCII character + * stream. * * @param columnName * the name of the column to read - * @return an InputStream with the data from the column + * @return an {@code InputStream} with the data from the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public InputStream getAsciiStream(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.math.BigDecimal. + * Gets the value of a column specified by column index as a {@code + * java.math.BigDecimal}. * * @param columnIndex - * the index of the column to read - * @return a BigDecimal with the value of the column + * the index of the column to read. + * @return a {@code BigDecimal} with the value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public BigDecimal getBigDecimal(int columnIndex) throws SQLException; /** - * @deprecated Gets the value of a column specified as a column index as a - * java.math.BigDecimal. + * Gets the value of a column specified by column index as a {@code + * java.math.BigDecimal}. + * + * @deprecated use {@link #getBigDecimal(int)} or + * {@link #getBigDecimal(String)} * @param columnIndex - * the index of the column to read + * the index of the column to read. * @param scale * the number of digits after the decimal point - * @return a BigDecimal with the value of the column + * @return a {@code BigDecimal} with the value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ @Deprecated public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException; /** - * Gets the value of a column specified as a column name, as a - * java.math.BigDecimal. + * Gets the value of a column specified by column name, as a {@code + * java.math.BigDecimal}. * * @param columnName - * the name of the column to read - * @return a BigDecimal with the value of the column + * the name of the column to read. + * @return a BigDecimal with value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public BigDecimal getBigDecimal(String columnName) throws SQLException; /** - * @deprecated Gets the value of a column specified as a column name, as a - * java.math.BigDecimal. + * Gets the value of a column specified by column name, as a {@code + * java.math.BigDecimal}. + * + * @deprecated use {@link #getBigDecimal(int)} or + * {@link #getBigDecimal(String)} * @param columnName - * the name of the column to read + * the name of the column to read. * @param scale * the number of digits after the decimal point - * @return a BigDecimal with the value of the column + * @return a BigDecimal with value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ @Deprecated public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException; /** - * Gets the value of a column specified as a column index as a binary + * Gets the value of a column specified by column index as a binary * stream. * <p> - * This method can be used to read LONGVARBINARY values. All of the data in - * the InputStream should be read before getting data from any other column. - * A further call to a getter method will implicitly close the InputStream. + * This method can be used to read {@code LONGVARBINARY} values. All of the + * data in the {@code InputStream} should be read before getting data from + * any other column. A further call to a getter method will implicitly close + * the {@code InputStream}. + * </p> * * @param columnIndex - * the index of the column to read - * @return an InputStream with the data from the column. If the column value - * is SQL NULL, null is returned. + * the index of the column to read. + * @return an {@code InputStream} with the data from the column. If the + * column value is SQL {@code NULL}, {@code null} is returned. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public InputStream getBinaryStream(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a binary stream. + * Gets the value of a column specified by column name as a binary stream. * <p> - * This method can be used to read LONGVARBINARY values. All of the data in - * the InputStream should be read before getting data from any other column. - * A further call to a getter method will implicitly close the InputStream. + * This method can be used to read {@code LONGVARBINARY} values. All of the + * data in the {@code InputStream} should be read before getting data from + * any other column. A further call to a getter method will implicitly close + * the {@code InputStream}. + * </p> * * @param columnName - * the name of the column to read - * @return an InputStream with the data from the column If the column value - * is SQL NULL, null is returned. + * the name of the column to read. + * @return an {@code InputStream} with the data from the column if the + * column value is SQL {@code NULL}, {@code null} is returned. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public InputStream getBinaryStream(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a java.sql.Blob - * object. + * Gets the value of a column specified by column index as a {@code + * java.sql.Blob} object. * * @param columnIndex - * the index of the column to read - * @return a java.sql.Blob with the value of the column + * the index of the column to read. + * @return a {@code java.sql.Blob} with the value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Blob getBlob(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as a java.sql.Blob - * object. + * Gets the value of a column specified by column name, as a {@code + * java.sql.Blob} object. * * @param columnName - * the name of the column to read - * @return a java.sql.Blob with the value of the column + * the name of the column to read. + * @return a {@code java.sql.Blob} with the value of the column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Blob getBlob(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a boolean. + * Gets the value of a column specified by column index as a {@code boolean} + * . * * @param columnIndex - * the index of the column to read - * @return a boolean value from the column. If the column is SQL NULL, false - * is returned. + * the index of the column to read. + * @return a {@code boolean} value from the column. If the column is SQL + * {@code NULL}, {@code false} is returned. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean getBoolean(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as a boolean. + * Gets the value of a column specified by column name, as a {@code boolean} + * . * * @param columnName - * the name of the column to read - * @return a boolean value from the column. If the column is SQL NULL, false - * is returned. + * the name of the column to read. + * @return a {@code boolean} value from the column. If the column is SQL + * {@code NULL}, {@code false} is returned. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean getBoolean(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a byte. + * Gets the value of a column specified by column index as a {@code byte}. * * @param columnIndex - * the index of the column to read - * @return a byte containing the value of the column. 0 if the value is SQL - * NULL. + * the index of the column to read. + * @return a {@code byte} equal to the value of the column. 0 if the value + * is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public byte getByte(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a byte. + * Gets the value of a column specified by column name as a {@code byte}. * * @param columnName - * the name of the column to read - * @return a byte containing the value of the column. 0 if the value is SQL - * NULL. + * the name of the column to read. + * @return a {@code byte} equal to the value of the column. 0 if the value + * is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public byte getByte(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a byte array. + * Gets the value of a column specified by column index as a byte array. * * @param columnIndex - * the index of the column to read - * @return a byte array containing the value of the column. null if the - * column contains SQL NULL. + * the index of the column to read. + * @return a byte array containing the value of the column. {@code null} if + * the column contains SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public byte[] getBytes(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a byte array. + * Gets the value of a column specified by column name as a byte array. * * @param columnName - * the name of the column to read - * @return a byte array containing the value of the column. null if the - * column contains SQL NULL. + * the name of the column to read. + * @return a byte array containing the value of the column. {@code null} if + * the column contains SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public byte[] getBytes(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.io.Reader object. + * Gets the value of a column specified by column index as a {@code + * java.io.Reader} object. * * @param columnIndex - * the index of the column to read - * @return a Reader holding the value of the column. null if the column - * value is SQL NULL. + * the index of the column to read. + * @return a {@code Reader} holding the value of the column. {@code null} if + * the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @see java.io.Reader + * @since Android 1.0 */ public Reader getCharacterStream(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a java.io.Reader - * object. + * Gets the value of a column specified by column name as a {@code + * java.io.Reader} object. * * @param columnName - * the name of the column to read - * @return a Reader holding the value of the column. null if the column - * value is SQL NULL. + * the name of the column to read. + * @return a {@code Reader} holding the value of the column. {@code null} if + * the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Reader getCharacterStream(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.sql.Clob. + * Gets the value of a column specified by column index as a {@code + * java.sql.Clob}. * * @param columnIndex - * the index of the column to read - * @return a Clob object representing the value in the column. null if the - * value is SQL NULL. + * the index of the column to read. + * @return a {@code Clob} object representing the value in the column. + * {@code null} if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Clob getClob(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a java.sql.Clob. + * Gets the value of a column specified by column name as a {@code + * java.sql.Clob}. * * @param colName - * the name of the column to read - * @return a Clob object representing the value in the column. null if the - * value is SQL NULL. + * the name of the column to read. + * @return a {@code Clob} object representing the value in the column. + * {@code null} if the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Clob getClob(String colName) throws SQLException; /** - * Gets the concurrency mode of this ResultSet. + * Gets the concurrency mode of this {@code ResultSet}. * - * @return the concurrency mode - one of: ResultSet.CONCUR_READ_ONLY, - * ResultSet.CONCUR_UPDATABLE + * @return the concurrency mode - one of: {@code ResultSet.CONCUR_READ_ONLY} + * , {@code ResultSet.CONCUR_UPDATABLE}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getConcurrency() throws SQLException; /** - * Gets the name of the SQL cursor of this ResultSet. + * Gets the name of the SQL cursor of this {@code ResultSet}. * - * @return a String containing the SQL cursor name + * @return the SQL cursor name. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public String getCursorName() throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.sql.Date. + * Gets the value of a column specified by column index as a {@code + * java.sql.Date}. * * @param columnIndex - * the index of the column to read - * @return a java.sql.Date matching the column value. null if the column is - * SQL NULL. + * the index of the column to read. + * @return a {@code java.sql.Date} matching the column value. {@code null} + * if the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Date getDate(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.sql.Date. This method uses a supplied calendar to compute the Date. + * Gets the value of a column specified by column index as a {@code + * java.sql.Date}. This method uses a supplied calendar to compute the Date. * * @param columnIndex - * the index of the column to read + * the index of the column to read. * @param cal - * a java.util.Calendar to use in constructing the Date. - * @return a java.sql.Date matching the column value. null if the column is - * SQL NULL. + * a {@code java.util.Calendar} to use in constructing the Date. + * @return a {@code java.sql.Date} matching the column value. {@code null} + * if the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Date getDate(int columnIndex, Calendar cal) throws SQLException; /** - * Gets the value of a column specified as a column name as a java.sql.Date. + * Gets the value of a column specified by column name as a {@code + * java.sql.Date}. * * @param columnName - * the name of the column to read - * @return a java.sql.Date matching the column value. null if the column is - * SQL NULL. + * the name of the column to read. + * @return a {@code java.sql.Date} matching the column value. {@code null} + * if the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Date getDate(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column name, as a java.sql.Date - * object. + * Gets the value of a column specified by column name, as a {@code + * java.sql.Date} object. * * @param columnName - * the name of the column to read + * the name of the column to read. * @param cal - * java.util.Calendar to use in constructing the Date. - * @return a java.sql.Date matching the column value. null if the column is - * SQL NULL. + * {@code java.util.Calendar} to use in constructing the Date. + * @return a {@code java.sql.Date} matching the column value. {@code null} + * if the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Date getDate(String columnName, Calendar cal) throws SQLException; /** - * Gets the value of a column specified as a column index as a double value. + * Gets the value of a column specified by column index as a {@code double} + * value. * * @param columnIndex - * the index of the column to read - * @return a double containing the column value. 0.0 if the column is SQL - * NULL. + * the index of the column to read. + * @return a {@code double} equal to the column value. {@code 0.0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public double getDouble(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a double value. + * Gets the value of a column specified by column name as a {@code double} + * value. * * @param columnName - * the name of the column to read - * @return a double containing the column value. 0.0 if the column is SQL - * NULL. + * the name of the column to read. + * @return a {@code double} equal to the column value. {@code 0.0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public double getDouble(String columnName) throws SQLException; /** - * Gets the direction in which rows are fetched for this ResultSet object. + * Gets the direction in which rows are fetched for this {@code ResultSet} + * object. * - * @return the fetch direction. Will be: ResultSet.FETCH_FORWARD, - * ResultSet.FETCH_REVERSE or ResultSet.FETCH_UNKNOWN + * @return the fetch direction. Will be one of: + * <ul> + * <li>ResultSet.FETCH_FORWARD</li><li>ResultSet.FETCH_REVERSE</li> + * <li>ResultSet.FETCH_UNKNOWN</li> + * </ul> * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getFetchDirection() throws SQLException; /** - * Gets the fetch size (in number of rows) for this ResultSet + * Gets the fetch size (in number of rows) for this {@code ResultSet}. * * @return the fetch size as an int * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getFetchSize() throws SQLException; /** - * Gets the value of a column specified as a column index as a float value. + * Gets the value of a column specified by column index as a {@code float} + * value. * * @param columnIndex - * the index of the column to read - * @return a float containing the column value. 0.0 if the column is SQL - * NULL. + * the index of the column to read. + * @return a {@code float} equal to the column value. {@code 0.0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public float getFloat(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a float value. + * Gets the value of a column specified by column name as a {@code float} + * value. * * @param columnName - * the name of the column to read - * @return a float containing the column value. 0.0 if the column is SQL - * NULL. + * the name of the column to read. + * @return a {@code float} equal to the column value. {@code 0.0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public float getFloat(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as an int value. + * Gets the value of a column specified by column index as an {@code int} + * value. * * @param columnIndex - * the index of the column to read - * @return an int containing the column value. 0 if the column is SQL NULL. + * the index of the column to read. + * @return an {@code int} equal to the column value. {@code 0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getInt(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as an int value. + * Gets the value of a column specified by column name, as an {@code int} + * value. * * @param columnName - * the name of the column to read - * @return an int containing the column value. 0 if the column is SQL NULL. + * the name of the column to read. + * @return an {@code int} equal to the column value. {@code 0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getInt(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a long value. + * Gets the value of a column specified by column index as a {@code long} + * value. * * @param columnIndex - * the index of the column to read - * @return a long containing the column value. 0 if the column is SQL NULL. + * the index of the column to read. + * @return a {@code long} equal to the column value. {@code 0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public long getLong(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as a long value. + * Gets the value of a column specified by column name, as a {@code long} + * value. * * @param columnName - * the name of the column to read - * @return a long containing the column value. 0 if the column is SQL NULL. + * the name of the column to read. + * @return a {@code long} equal to the column value. {@code 0} if the + * column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public long getLong(String columnName) throws SQLException; /** - * Gets the Metadata for this ResultSet. This defines the number, types and - * properties of the columns in the ResultSet. + * Gets the metadata for this {@code ResultSet}. This defines the number, + * types and properties of the columns in the {@code ResultSet}. * - * @return a ResultSetMetaData object with information about this ResultSet. + * @return a {@code ResultSetMetaData} object with information about this + * {@code ResultSet}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public ResultSetMetaData getMetaData() throws SQLException; /** - * Gets the value of a specified column as a Java Object. The type of the - * returned object will be the default according to the column's SQL type, - * following the JDBC specification for built-in types. + * Gets the value of a specified column as a Java {@code Object}. The type + * of the returned object will be the default according to the column's SQL + * type, following the JDBC specification for built-in types. * <p> * For SQL User Defined Types, if a column value is Structured or Distinct, - * this method behaves the same as a call to: getObject(columnIndex, - * this.getStatement().getConnection().getTypeMap()) + * this method behaves the same as a call to: {@code + * getObject(columnIndex,this.getStatement().getConnection().getTypeMap())} + * </p> * * @param columnIndex - * the index of the column to read - * @return an Object containing the value of the column. null if the column - * value is SQL NULL. + * the index of the column to read. + * @return an {@code Object} containing the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Object getObject(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column index as a Java Object. + * Gets the value of a column specified by column index as a Java {@code + * Object}. * <p> * The type of the Java object will be determined by the supplied Map to - * perform the mapping of SQL Struct or Distinct types into Java objects. + * perform the mapping of SQL {@code Struct} or Distinct types into Java + * objects. + * </p> * * @param columnIndex - * the index of the column to read + * the index of the column to read. * @param map - * a java.util.Map containing a mapping from SQL Type names to - * Java classes. - * @return an Object containing the value of the column. null if the column - * value is SQL NULL. + * a {@code java.util.Map} containing a mapping from SQL Type + * names to Java classes. + * @return an {@code Object} containing the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException; /** - * Gets the value of a specified column as a Java Object. The type of the - * returned object will be the default according to the column's SQL type, - * following the JDBC specification for built-in types. + * Gets the value of a specified column as a Java {@code Object}. The type + * of the returned object will be the default according to the column's SQL + * type, following the JDBC specification for built-in types. * <p> - * For SQL User Defined Types, if a column value is Structured or Distinct, - * this method behaves the same as a call to: getObject(columnIndex, - * this.getStatement().getConnection().getTypeMap()) + * For SQL User Defined Types, if a column value is structured or distinct, + * this method behaves the same as a call to: {@code + * getObject(columnIndex,this.getStatement().getConnection().getTypeMap())} + * </p> * * @param columnName - * the name of the column to read - * @return an Object containing the value of the column. null if the column - * value is SQL NULL. + * the name of the column to read. + * @return an {@code Object} containing the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Object getObject(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column name as a Java Object. + * Gets the value of a column specified by column name as a Java {@code + * Object}. * <p> * The type of the Java object will be determined by the supplied Map to * perform the mapping of SQL Struct or Distinct types into Java objects. + * </p> * * @param columnName - * the name of the column to read + * the name of the column to read. * @param map - * a java.util.Map containing a mapping from SQL Type names to + * a {@code java.util.Map} containing a mapping from SQL Type names to * Java classes. - * @return an Object containing the value of the column. null if the column - * value is SQL NULL. + * @return an {@code Object} containing the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Object getObject(String columnName, Map<String, Class<?>> map) throws SQLException; /** - * Gets the value of a column specified as a column index as a Java - * java.sql.Ref. + * Gets the value of a column specified by column index as a Java {@code + * java.sql.Ref}. * * @param columnIndex - * the index of the column to read + * the index of the column to read. * @return a Ref representing the value of the SQL REF in the column * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Ref getRef(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a Java - * java.sql.Ref. + * Gets the value of a column specified by column name as a Java {@code + * java.sql.Ref}. * * @param colName - * the name of the column to read - * @return a Ref representing the value of the SQL REF in the column + * the name of the column to read. + * @return a Ref representing the value of the SQL {@code REF} in the column * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Ref getRef(String colName) throws SQLException; /** - * Gets the number of the current row in the ResultSet. Row numbers start at - * 1 for the first row. + * Gets the number of the current row in the {@code ResultSet}. Row numbers + * start at 1 for the first row. * - * @return the index number of the current row. 0 is returned if there is no - * current row. + * @return the index number of the current row. {@code 0} is returned if + * there is no current row. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public int getRow() throws SQLException; /** - * Gets the value of a column specified as a column index as a short value. + * Gets the value of a column specified by column index as a short value. * * @param columnIndex - * the index of the column to read - * @return a short value containing the value of the column. 0 if the value - * is SQL NULL. + * the index of the column to read. + * @return a short value equal to the value of the column. {@code 0} if + * the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public short getShort(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as a short value. + * Gets the value of a column specified by column name, as a short value. * * @param columnName - * the name of the column to read - * @return a short value containing the value of the column. 0 if the value - * is SQL NULL. + * the name of the column to read. + * @return a short value equal to the value of the column. {@code 0} if + * the value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public short getShort(String columnName) throws SQLException; /** - * Gets the Statement that produced this ResultSet. If the ResultSet was not - * created by a Statement (eg it was returned from one of the - * DatabaseMetaData methods), null is returned. + * Gets the statement that produced this {@code ResultSet}. If the {@code + * ResultSet} was not created by a statement (i.e. because it was returned + * from one of the {@link DatabaseMetaData} methods), {@code null} is + * returned. * - * @return the Statement which produced this ResultSet, or null if the - * ResultSet was not created by a Statement. + * @return the Statement which produced this {@code ResultSet}, or {@code + * null} if the {@code ResultSet} was not created by a Statement. * @throws SQLException + * if a database error happens. + * @since Android 1.0 */ public Statement getStatement() throws SQLException; /** - * Gets the value of a column specified as a column index as a String. + * Gets the value of a column specified by column index as a String. * * @param columnIndex - * the index of the column to read - * @return the String representing the value of the column, null if the - * column is SQL NULL. + * the index of the column to read. + * @return the String representing the value of the column, {@code null} if + * the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public String getString(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name, as a String. + * Gets the value of a column specified by column name, as a String. * * @param columnName - * the name of the column to read - * @return the String representing the value of the column, null if the - * column is SQL NULL. + * the name of the column to read. + * @return the String representing the value of the column, {@code null} if + * the column is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public String getString(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a java.sql.Time - * value. + * Gets the value of a column specified by column index as a {@code + * java.sql.Time} value. * * @param columnIndex - * the index of the column to read - * @return a Time representing the column value, null if the column value is - * SQL NULL. + * the index of the column to read. + * @return a Time representing the column value, {@code null} if the column + * value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Time getTime(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column index as a java.sql.Time - * value. The supplied Calendar is used to map between the SQL Time value - * and the Java Time value. + * Gets the value of a column specified by column index as a {@code + * java.sql.Time} value. The supplied {@code Calendar} is used to + * map the SQL {@code Time} value to a Java Time value. * * @param columnIndex - * the index of the column to read + * the index of the column to read. * @param cal - * a Calendar to use in creating the Java Time value. - * @return a Time representing the column value, null if the column value is - * SQL NULL. + * a {@code Calendar} to use in creating the Java Time value. + * @return a Time representing the column value, {@code null} if the column + * value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Time getTime(int columnIndex, Calendar cal) throws SQLException; /** - * Gets the value of a column specified as a column name, as a java.sql.Time - * value. + * Gets the value of a column specified by column name, as a {@code + * java.sql.Time} value. * * @param columnName - * the name of the column to read - * @return a Time representing the column value, null if the column value is - * SQL NULL. + * the name of the column to read. + * @return the column value, {@code null} if the column value is SQL {@code + * NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Time getTime(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index, as a - * java.sql.Time value. The supplied Calendar is used to map between the SQL - * Time value and the Java Time value. + * Gets the value of a column specified by column index, as a {@code + * java.sql.Time} value. The supplied {@code Calendar} is used to + * map the SQL {@code Time} value to a Java Time value. * * @param columnName - * the name of the column to read + * the name of the column to read. * @param cal - * a Calendar to use in creating the Java Time value. - * @return a Time representing the column value, null if the column value is - * SQL NULL. + * a {@code Calendar} to use in creating the Java time value. + * @return a Time representing the column value, {@code null} if the column + * value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Time getTime(String columnName, Calendar cal) throws SQLException; /** - * Gets the value of a column specified as a column index as a - * java.sql.Timestamp value. + * Gets the value of a column specified by column index as a {@code + * java.sql.Timestamp} value. * * @param columnIndex - * the index of the column to read - * @return a Timestamp representing the column value, null if the column - * value is SQL NULL. + * the index of the column to read. + * @return a timestamp representing the column value, {@code null} if the + * column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Timestamp getTimestamp(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column index, as a - * java.sql.Timestamp value. The supplied Calendar is used to map between - * the SQL Timestamp value and the Java Timestamp value. + * Gets the value of a column specified by column index, as a {@code + * java.sql.Timestamp} value. The supplied Calendar is used when mapping + * the SQL {@code Timestamp} value to a Java {@code Timestamp} value. * * @param columnIndex - * the index of the column to read + * the index of the column to read. * @param cal - * Calendar to use in creating the Java Timestamp value. - * @return a Timestamp representing the column value, null if the column - * value is SQL NULL. + * Calendar to use in creating the Java timestamp value. + * @return a timestamp representing the column value, {@code null} if the + * column value is SQL NULL. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException; /** - * Gets the value of a column specified as a column name, as a - * java.sql.Timestamp value. + * Gets the value of a column specified by column name, as a {@code + * java.sql.Timestamp} value. * * @param columnName - * the name of the column to read - * @return a Timestamp representing the column value, null if the column - * value is SQL NULL. + * the name of the column to read. + * @return a timestamp representing the column value, {@code null} if the + * column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Timestamp getTimestamp(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column name, as a - * java.sql.Timestamp value. The supplied Calendar is used to map between - * the SQL Timestamp value and the Java Timestamp value. + * Gets the value of a column specified by column name, as a {@code + * java.sql.Timestamp} value. The supplied Calendar is used when mapping + * the SQL {@code Timestamp} value to a Java {@code Timestamp} value. * * @param columnName - * the name of the column to read + * the name of the column to read. * @param cal - * Calendar to use in creating the Java Timestamp value. - * @return a Timestamp representing the column value, null if the column - * value is SQL NULL. + * Calendar to use in creating the Java {@code Timestamp} value. + * @return a timestamp representing the column value, {@code null} if the + * column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException; /** - * Gets the type of the ResultSet. + * Gets the type of the {@code ResultSet}. * - * @return The ResultSet type, one of: ResultSet.TYPE_FORWARD_ONLY, - * ResultSet.TYPE_SCROLL_INSENSITIVE, or - * ResultSet.TYPE_SCROLL_SENSITIVE + * @return The {@code ResultSet} type, one of: + * <ul> + * <li>{@code ResultSet.TYPE_FORWARD_ONLY}</li> <li>{@code + * ResultSet.TYPE_SCROLL_INSENSITIVE}</li> <li>{@code + * ResultSet.TYPE_SCROLL_SENSITIVE}</li> + * </ul> * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int getType() throws SQLException; /** + * Gets the value of the column as an {@code InputStream} of unicode + * characters. + * * @deprecated Use {@link #getCharacterStream}. - * <p> - * Gets the value of the column as an InputStream of Unicode - * characters. * @param columnIndex - * the index of the column to read - * @return an InputStream holding the value of the column. null if the - * column value is SQL NULL. + * the index of the column to read. + * @return an {@code InputStream} holding the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ @Deprecated public InputStream getUnicodeStream(int columnIndex) throws SQLException; /** + * Gets the value of the column as an {@code InputStream} of Unicode + * characters. + * * @deprecated Use {@link #getCharacterStream} - * <p> - * Gets the value of the column as an InputStream of Unicode - * characters. * @param columnName - * the name of the column to read - * @return an InputStream holding the value of the column. null if the - * column value is SQL NULL. + * the name of the column to read. + * @return an {@code InputStream} holding the value of the column. {@code + * null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ @Deprecated public InputStream getUnicodeStream(String columnName) throws SQLException; /** - * Gets the value of a column specified as a column index as a java.net.URL. + * Gets the value of a column specified by column index as a {@code + * java.net.URL}. * * @param columnIndex - * the index of the column to read - * @return a URL. null if the column value is SQL NULL. + * the index of the column to read. + * @return a URL. {@code null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public URL getURL(int columnIndex) throws SQLException; /** - * Gets the value of a column specified as a column name as a java.net.URL - * object. + * Gets the value of a column specified by column name as a {@code + * java.net.URL} object. * * @param columnName - * the name of the column to read - * @return a URL. null if the column value is SQL NULL. + * the name of the column to read. + * @return the column vaule as a URL. {@code null} if the column value is SQL {@code NULL}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public URL getURL(String columnName) throws SQLException; /** - * Gets the first warning generated by calls on this ResultSet. Subsequent - * warnings on this ResultSet are chained to the first one. + * Gets the first warning generated by calls on this {@code ResultSet}. + * Subsequent warnings on this {@code ResultSet} are chained to the first + * one. * <p> - * The warnings are cleared when a new Row is read from the ResultSet. The - * warnings returned by this method are only the warnings generated by - * ResultSet method calls - warnings generated by Statement methods are held - * by the Statement. + * The warnings are cleared when a new Row is read from the {@code + * ResultSet}. The warnings returned by this method are only the warnings + * generated by {@code ResultSet} method calls - warnings generated by + * Statement methods are held by the Statement. * <p> - * An SQLException is generated if this method is called on a closed - * ResultSet. + * </p> + * An {@code SQLException} is generated if this method is called on a closed + * {@code ResultSet}. </p> * - * @return an SQLWarning which is the first warning for this ResultSet. null - * if there are no warnings. + * @return an SQLWarning which is the first warning for this {@code + * ResultSet}. {@code null} if there are no warnings. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public SQLWarning getWarnings() throws SQLException; /** - * Insert the insert row into the ResultSet and into the underlying - * database. The Cursor must be set to the Insert Row before this method is + * Insert the insert row into the {@code ResultSet} and into the underlying + * database. The cursor must be set to the Insert Row before this method is * invoked. * * @throws SQLException * if a database error happens. Particular cases include the - * Cursor not being on the Insert Row or if any Columns in the - * Row do not have a value where the column is declared as + * cursor not being on the Insert Row or if any columns in the + * row do not have a value where the column is declared as * not-nullable. + * @since Android 1.0 */ public void insertRow() throws SQLException; /** - * Gets if the cursor is after the last row of the ResultSet. + * Gets if the cursor is after the last row of the {@code ResultSet}. * - * @return true if the Cursor is after the last Row in the ResultSet, false - * if the cursor is at any other position in the ResultSet. + * @return {@code true} if the cursor is after the last row in the {@code + * ResultSet}, {@code false} if the cursor is at any other position + * in the {@code ResultSet}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean isAfterLast() throws SQLException; /** - * Gets if the cursor is before the first row of the ResultSet. + * Gets if the cursor is before the first row of the {@code ResultSet}. * - * @return true if the Cursor is before the last Row in the ResultSet, false - * if the cursor is at any other position in the ResultSet. + * @return {@code true} if the cursor is before the first row in the {@code + * ResultSet}, {@code false} if the cursor is at any other position + * in the {@code ResultSet}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean isBeforeFirst() throws SQLException; /** - * Gets if the cursor is on the first row of the ResultSet. + * Gets if the cursor is on the first row of the {@code ResultSet}. * - * @return true if the Cursor is on the first Row in the ResultSet, false if - * the cursor is at any other position in the ResultSet. + * @return {@code true} if the cursor is on the first row in the {@code + * ResultSet}, {@code false} if the cursor is at any other position + * in the {@code ResultSet}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean isFirst() throws SQLException; /** - * Gets if the cursor is on the last row of the ResultSet + * Gets if the cursor is on the last row of the {@code ResultSet} * - * @return true if the Cursor is on the last Row in the ResultSet, false if - * the cursor is at any other position in the ResultSet. + * @return {@code true} if the cursor is on the last row in the {@code + * ResultSet}, {@code false} if the cursor is at any other position + * in the {@code ResultSet}. * @throws SQLException + * if a database error happens. + * @since Android 1.0 */ public boolean isLast() throws SQLException; /** - * Shifts the cursor position to the last row of the ResultSet. + * Shifts the cursor position to the last row of the {@code ResultSet}. * - * @return true if the new position is in a legitimate row, false if the - * ResultSet contains no rows. + * @return {@code true} if the new position is in a legitimate row, {@code + * false} if the {@code ResultSet} contains no rows. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean last() throws SQLException; /** - * Moves the cursor to the remembered position, usually the current row. - * This only applies if the cursor is on the Insert row. + * Moves the cursor to the remembered position, namely the + * row that was the current row before a call to {@code moveToInsertRow}. + * This only applies if the cursor is on the Insert Row. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void moveToCurrentRow() throws SQLException; /** - * Moves the cursor position to the Insert row. The current position is - * remembered and the cursor is positioned at the Insert row. The columns in - * the Insert row should be filled in with the appropriate update methods, - * before calling <code>insertRow</code> to insert the new row into the - * database. + * Moves the cursor position to the Insert Row. The current position is + * remembered and the cursor is positioned at the Insert Row. The columns in + * the Insert Row should be filled in with the appropriate update methods, + * before calling {@code insertRow} to insert the new row into the database. * * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void moveToInsertRow() throws SQLException; /** - * Shifts the cursor position down one row in this ResultSet object. + * Shifts the cursor position down one row in this {@code ResultSet} object. * <p> - * Any InputStreams associated with the current row are closed and any + * Any input streams associated with the current row are closed and any * warnings are cleared. + * </p> * - * @return true if the updated cursor position is pointing to a valid row, - * false otherwise (ie when the cursor is after the last row in the - * ResultSet). + * @return {@code true} if the updated cursor position is pointing to a + * valid row, {@code false} otherwise (i.e. when the cursor is after + * the last row in the {@code ResultSet}). * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean next() throws SQLException; /** - * Relocates the cursor position to the preceding row in this ResultSet. + * Relocates the cursor position to the preceding row in this {@code + * ResultSet}. * - * @return true if the new position is in a legitimate row, false if the - * cursor is now before the first row. + * @return {@code true} if the new position is in a legitimate row, {@code + * false} if the cursor is now before the first row. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean previous() throws SQLException; /** * Refreshes the current row with its most up to date value in the database. - * Must not be called when the cursor is on the Insert row. + * Must not be called when the cursor is on the Insert Row. * <p> - * If any columns in the current row have been updated but the - * <code>updateRow</code> has not been called, then the updates are lost - * when this method is called. + * If any columns in the current row have been updated but the {@code + * updateRow} has not been called, then the updates are lost when this + * method is called. + * </p> * * @throws SQLException - * if a database error happens, including if the current row is + * if a database error happens., including if the current row is * the Insert row. + * @since Android 1.0 */ public void refreshRow() throws SQLException; /** * Moves the cursor position up or down by a specified number of rows. If - * the new position is beyond the start or end rows, the cursor position is - * set before the first row/after the last row. + * the new position is beyond the start row (or end row), the cursor position is + * set before the first row (or, respectively, after the last row). * * @param rows * a number of rows to move the cursor - may be positive or * negative - * @return true if the new cursor position is on a row, false otherwise + * @return {@code true} if the new cursor position is on a row, {@code + * false} otherwise * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean relative(int rows) throws SQLException; @@ -1214,10 +1389,11 @@ public interface ResultSet { * Indicates whether a row has been deleted. This method depends on whether * the JDBC driver and database can detect deletions. * - * @return true if a row has been deleted and if deletions are detected, - * false otherwise. + * @return {@code true} if a row has been deleted and if deletions are + * detected, {@code false} otherwise. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean rowDeleted() throws SQLException; @@ -1226,10 +1402,11 @@ public interface ResultSet { * method depends on whether the JDBC driver and database can detect * insertions. * - * @return true if a row has been inserted and if insertions are detected, - * false otherwise. + * @return {@code true} if a row has been inserted and if insertions are + * detected, {@code false} otherwise. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean rowInserted() throws SQLException; @@ -1237,61 +1414,70 @@ public interface ResultSet { * Indicates whether the current row has been updated. This method depends * on whether the JDBC driver and database can detect updates. * - * @return true if the current row has been updated and if updates can be - * detected, false otherwise. + * @return {@code true} if the current row has been updated and if updates + * can be detected, {@code false} otherwise. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean rowUpdated() throws SQLException; /** * Indicates which direction (forward/reverse) will be used to process the - * rows of this ResultSet object. This is treated as a hint by the JDBC - * driver. + * rows of this {@code ResultSet} object. This is treated as a hint by the + * JDBC driver. * * @param direction - * can be ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or - * ResultSet.FETCH_UNKNOWN + * can be {@code ResultSet.FETCH_FORWARD}, {@code + * ResultSet.FETCH_REVERSE}, or {@code ResultSet.FETCH_UNKNOWN} * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public void setFetchDirection(int direction) throws SQLException; /** - * Indicates the amount of rows to fetch from the database when extra rows - * are required for this ResultSet. This used as a hint to the JDBC driver. + * Indicates the number of rows to fetch from the database when extra rows + * are required for this {@code ResultSet}. This used as a hint to the JDBC + * driver. * * @param rows - * the number of rows to fetch. 0 implies that the JDBC driver - * can make its own decision about the fetch size. The number - * should not be greater than the maximum number of rows - * established by the Statement that generated the ResultSet. + * the number of rows to fetch. {@code 0} implies that the JDBC + * driver can make its own decision about the fetch size. The + * number should not be greater than the maximum number of rows + * established by the statement that generated the {@code + * ResultSet}. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void setFetchSize(int rows) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.Array value. + * Updates a column specified by a column index with a {@code + * java.sql.Array} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateArray(int columnIndex, Array x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.Array value. + * Updates a column specified by a column name with a {@code java.sql.Array} + * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateArray(String columnName, Array x) throws SQLException; @@ -1299,13 +1485,14 @@ public interface ResultSet { * Updates a column specified by a column index with an ASCII stream value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param length * the length of the data to write from the stream * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException; @@ -1314,41 +1501,44 @@ public interface ResultSet { * Updates a column specified by a column name with an Ascii stream value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param length * the length of the data to write from the stream * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.BigDecimal - * value. + * Updates a column specified by a column index with a {@code + * java.sql.BigDecimal} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.BigDecimal - * value. + * Updates a column specified by a column name with a {@code + * java.sql.BigDecimal} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException; @@ -1357,12 +1547,14 @@ public interface ResultSet { * Updates a column specified by a column index with a binary stream value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param length + * the number of bytes to be read from the the stream. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException; @@ -1371,96 +1563,110 @@ public interface ResultSet { * Updates a column specified by a column name with a binary stream value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param length + * he number of bytes to be read from the the stream. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.Blob value. + * Updates a column specified by a column index with a {@code java.sql.Blob} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBlob(int columnIndex, Blob x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.Blob value. + * Updates a column specified by a column name with a {@code java.sql.Blob} + * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBlob(String columnName, Blob x) throws SQLException; /** - * Updates a column specified by a column index with a boolean value. + * Updates a column specified by a column index with a {@code boolean} + * value. * * @param columnIndex + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBoolean(int columnIndex, boolean x) throws SQLException; /** - * Updates a column specified by a column name with a boolean value. + * Updates a column specified by a column name with a {@code boolean} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBoolean(String columnName, boolean x) throws SQLException; /** - * Updates a column specified by a column index with a byte value. + * Updates a column specified by a column index with a {@code byte} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateByte(int columnIndex, byte x) throws SQLException; /** - * Updates a column specified by a column name with a byte value. + * Updates a column specified by a column name with a {@code byte} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateByte(String columnName, byte x) throws SQLException; /** - * Updates a column specified by a column index with a byte array value. + * Updates a column specified by a column index with a {@code byte} array + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBytes(int columnIndex, byte[] x) throws SQLException; @@ -1468,11 +1674,12 @@ public interface ResultSet { * Updates a column specified by a column name with a byte array value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateBytes(String columnName, byte[] x) throws SQLException; @@ -1481,13 +1688,14 @@ public interface ResultSet { * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param length * the length of data to write from the stream * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException; @@ -1497,374 +1705,418 @@ public interface ResultSet { * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param reader - * the new value for the specified column + * the new value for the specified column. * @param length * the length of data to write from the Reader * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.Clob value. + * Updates a column specified by a column index with a {@code java.sql.Clob} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateClob(int columnIndex, Clob x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.Clob value. + * Updates a column specified by a column name with a {@code java.sql.Clob} + * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateClob(String columnName, Clob x) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.Date value. + * Updates a column specified by a column index with a {@code java.sql.Date} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateDate(int columnIndex, Date x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.Date value. + * Updates a column specified by a column name with a {@code java.sql.Date} + * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateDate(String columnName, Date x) throws SQLException; /** - * Updates a column specified by a column index with a double value. + * Updates a column specified by a column index with a {@code double} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateDouble(int columnIndex, double x) throws SQLException; /** - * Updates a column specified by a column name with a double value. + * Updates a column specified by a column name with a {@code double} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateDouble(String columnName, double x) throws SQLException; /** - * Updates a column specified by a column index with a float value. + * Updates a column specified by a column index with a {@code float} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateFloat(int columnIndex, float x) throws SQLException; /** - * Updates a column specified by a column name with a float value. + * Updates a column specified by a column name with a {@code float} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateFloat(String columnName, float x) throws SQLException; /** - * Updates a column specified by a column index with an int value. + * Updates a column specified by a column index with an {@code int} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateInt(int columnIndex, int x) throws SQLException; /** - * Updates a column specified by a column name with an int value. + * Updates a column specified by a column name with an {@code int} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateInt(String columnName, int x) throws SQLException; /** - * Updates a column specified by a column index with a long value. + * Updates a column specified by a column index with a {@code long} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column.. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateLong(int columnIndex, long x) throws SQLException; /** - * Updates a column specified by a column name with a long value. + * Updates a column specified by a column name with a {@code long} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateLong(String columnName, long x) throws SQLException; /** - * Updates a column specified by a column index with a null value. + * Updates a column specified by a column index with a {@code null} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateNull(int columnIndex) throws SQLException; /** - * Updates a column specified by a column name with a null value. + * Updates a column specified by a column name with a {@code null} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateNull(String columnName) throws SQLException; /** - * Updates a column specified by a column index with an Object value. + * Updates a column specified by a column index with an {@code Object} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateObject(int columnIndex, Object x) throws SQLException; /** - * Updates a column specified by a column index with an Object value. + * Updates a column specified by a column index with an {@code Object} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param scale - * for the types java.sql.Types.DECIMAL or - * java.sql.Types.NUMERIC, this specifies the number of digits + * for the types {@code java.sql.Types.DECIMAL} or {@code + * java.sql.Types.NUMERIC}, this specifies the number of digits * after the decimal point. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateObject(int columnIndex, Object x, int scale) throws SQLException; /** - * Updates a column specified by a column name with an Object value. + * Updates a column specified by a column name with an {@code Object} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateObject(String columnName, Object x) throws SQLException; /** - * Updates a column specified by a column name with an Object value. + * Updates a column specified by a column name with an {@code Object} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @param scale - * for the types java.sql.Types.DECIMAL or - * java.sql.Types.NUMERIC, this specifies the number of digits + * for the types {@code java.sql.Types.DECIMAL} or {@code + * java.sql.Types.NUMERIC}, this specifies the number of digits * after the decimal point. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateObject(String columnName, Object x, int scale) throws SQLException; /** - * Updates a column specified by a column index with a java.sql.Ref value. + * Updates a column specified by a column index with a {@code java.sql.Ref} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateRef(int columnIndex, Ref x) throws SQLException; /** - * Updates a column specified by a column name with a java.sql.Ref value. + * Updates a column specified by a column name with a {@code java.sql.Ref} + * value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateRef(String columnName, Ref x) throws SQLException; /** * Updates the database with the new contents of the current row of this - * ResultSet object. + * {@code ResultSet} object. * * @throws SQLException + * if a database error happens. + * @since Android 1.0 */ public void updateRow() throws SQLException; /** - * Updates a column specified by a column index with a short value. + * Updates a column specified by a column index with a {@code short} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateShort(int columnIndex, short x) throws SQLException; /** - * Updates a column specified by a column name with a short value. + * Updates a column specified by a column name with a {@code short} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateShort(String columnName, short x) throws SQLException; /** - * Updates a column specified by a column index with a String value. + * Updates a column specified by a column index with a {@code String} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateString(int columnIndex, String x) throws SQLException; /** - * Updates a column specified by a column name with a String value. + * Updates a column specified by a column name with a {@code String} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateString(String columnName, String x) throws SQLException; /** - * Updates a column specified by a column index with a Time value. + * Updates a column specified by a column index with a {@code Time} value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateTime(int columnIndex, Time x) throws SQLException; /** - * Updates a column specified by a column name with a Time value. + * Updates a column specified by a column name with a {@code Time} value. * * @param columnName + * the name of the column to update. * @param x - * the new value for the specified column + * the new value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateTime(String columnName, Time x) throws SQLException; /** - * Updates a column specified by a column index with a Timestamp value. + * Updates a column specified by a column index with a {@code Timestamp} + * value. * * @param columnIndex - * the index of the column to update + * the index of the column to update. * @param x - * the new value for the specified column + * the new timestamp value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException; /** - * Updates a column specified by column name with a Timestamp value. + * Updates a column specified by column name with a {@code Timestamp} value. * * @param columnName - * the name of the column to update + * the name of the column to update. * @param x + * the new timestamp value for the specified column. * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public void updateTimestamp(String columnName, Timestamp x) throws SQLException; /** - * Determines if the last column read from this ResultSet contained SQL - * NULL. + * Determines whether the last column read from this {@code ResultSet} + * contained SQL {@code NULL}. * - * @return true if the last column contained SQL NULL, false otherwise + * @return {@code {@code true} if the last column contained SQL {@code + * NULL}, {@code false} otherwise * @throws SQLException - * if a database error happens + * if a database error happens. + * @since Android 1.0 */ public boolean wasNull() throws SQLException; } diff --git a/sql/src/main/java/java/sql/ResultSetMetaData.java b/sql/src/main/java/java/sql/ResultSetMetaData.java index d530d11..95c515d 100644 --- a/sql/src/main/java/java/sql/ResultSetMetaData.java +++ b/sql/src/main/java/java/sql/ResultSetMetaData.java @@ -18,54 +18,66 @@ package java.sql; /** - * Provides information about the columns in a ResultSet. + * Provides information about the columns returned in a {@code ResultSet}. + * + * @since Android 1.0 */ public interface ResultSetMetaData { /** - * Indicates that a column cannot contain NULL values + * Indicates that a column cannot contain {@code NULL} values. + * + * @since Android 1.0 */ public static final int columnNoNulls = 0; /** - * Indicates that a column can contain NULL values + * Indicates that a column can contain {@code NULL} values. + * + * @since Android 1.0 */ public static final int columnNullable = 1; /** - * Indicates that it is unknown whether a column can contain NULLs or not + * Indicates that it is unknown whether a column can contain {@code NULL}s or not. + * + * @since Android 1.0 */ public static final int columnNullableUnknown = 2; /** - * Returns the title of indexed columns catalog + * Returns the title of an indexed column's catalog. * * @param column - * the column index, starting at 1 - * @return the catalog title + * the column index, starting at 1. + * @return the catalog title. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getCatalogName(int column) throws SQLException; /** * Returns the fully-qualified type of the class that is produced when - * invoking ResultSet.getObject to recover this columns value. + * invoking {@code ResultSet.getObject} to recover this column's value. * * @param column - * the column index, starting at 1 - * @return the fully-qualified class name + * the column index, starting at 1. + * @return the fully-qualified class name. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see ResultSet#getObject + * @since Android 1.0 */ public String getColumnClassName(int column) throws SQLException; /** - * Returns a count of the columns in this set of results. + * Returns number of columns contained in the associated result set. * - * @return the column count + * @return the column count. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int getColumnCount() throws SQLException; @@ -74,10 +86,11 @@ public interface ResultSetMetaData { * of characters. * * @param column - * the column index, starting at 1 - * @return the column's max width + * the column index, starting at 1. + * @return the column's max width. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int getColumnDisplaySize(int column) throws SQLException; @@ -86,76 +99,85 @@ public interface ResultSetMetaData { * title needs to be displayed. * * @param column - * the column index, starting at 1 - * @return the column's title + * the column index, starting at 1. + * @return the column's title. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getColumnLabel(int column) throws SQLException; /** - * Returns the title of the indexed column + * Returns the title of the indexed column. * * @param column - * the column index, starting at 1 - * @return the column title + * the column index, starting at 1. + * @return the column title. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getColumnName(int column) throws SQLException; /** - * Returns the type of the indexed column + * Returns the type of the indexed column as SQL type code. * * @param column - * the column index, starting at 1 - * @return the column type + * the column index, starting at 1. + * @return the column type code. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Types + * @since Android 1.0 */ public int getColumnType(int column) throws SQLException; /** - * Returns the type name of the indexed column + * Returns the type name of the indexed column. * * @param column - * the column index, starting at 1 - * @return the type name + * the column index, starting at 1. + * @return the type name. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getColumnTypeName(int column) throws SQLException; /** - * Returns the decimal precision of the indexed column + * Returns the decimal precision of the indexed column. * * @param column - * the column index, starting at 1 - * @return the precision + * the column index, starting at 1. + * @return the precision. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int getPrecision(int column) throws SQLException; /** - * Returns the number of decimal places in the indexed column. + * Returns the number of digits to the right of the decimal point of the + * indexed column. * * @param column - * the column index, starting at 1 - * @return number of decimal places + * the column index, starting at 1. + * @return number of decimal places. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int getScale(int column) throws SQLException; /** - * Returns the name of the indexed columns schema + * Returns the name of the indexed columns schema. * * @param column - * the column index, starting at 1 - * @return the name of the columns schema + * the column index, starting at 1. + * @return the name of the columns schema. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getSchemaName(int column) throws SQLException; @@ -163,57 +185,63 @@ public interface ResultSetMetaData { * Returns the title of the indexed columns table. * * @param column - * the column index, starting at 1 - * @return the table title + * the column index, starting at 1. + * @return the table title. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String getTableName(int column) throws SQLException; /** - * Returns and indication of whether the indexed column has automatic - * numbering and is therefore read-only + * Returns an indication of whether the indexed column is automatically + * incremented and is therefore read-only. * * @param column - * the column index, starting at 1 - * @return true if it is automatically numbered, false otherwise + * the column index, starting at 1. + * @return {@code true} if it is automatically numbered, {@code false} + * otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isAutoIncrement(int column) throws SQLException; /** - * Returns an indicator of whether the case of the indexed column is - * important + * Returns an indication of whether the case of the indexed column is + * important. * * @param column - * the column index, starting at 1 - * @return true if case matters, false otherwise + * the column index, starting at 1. + * @return {@code true} if case matters, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isCaseSensitive(int column) throws SQLException; /** - * Returns if the indexed column contains a monetary amount. + * Returns whether the indexed column contains a monetary amount. * * @param column - * the column index, starting at 1 - * @return true if it is a monetary value, false otherwise + * the column index, starting at 1. + * @return {@code true} if it is a monetary value, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isCurrency(int column) throws SQLException; /** * Returns an indication of whether writing to the indexed column is - * guaranteed to be successful + * guaranteed to be successful. * * @param column - * the column index, starting at 1 - * @return true if the write is guaranteed, false otherwise + * the column index, starting at 1. + * @return {@code true} if the write is guaranteed, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isDefinitelyWritable(int column) throws SQLException; @@ -221,22 +249,24 @@ public interface ResultSetMetaData { * Returns whether the indexed column is nullable. * * @param column - * the column index, starting at 1 - * @return true if it is nullable, false otherwise + * the column index, starting at 1. + * @return {@code true} if it is nullable, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int isNullable(int column) throws SQLException; /** * Returns an indication of whether writing to the indexed column is - * guaranteed to be unsuccessful + * guaranteed to be unsuccessful. * * @param column - * the column index, starting at 1 - * @return true if the column is read-only, false otherwise + * the column index, starting at 1. + * @return {@code true} if the column is read-only, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isReadOnly(int column) throws SQLException; @@ -244,22 +274,25 @@ public interface ResultSetMetaData { * Returns an indication of whether the indexed column is searchable. * * @param column - * the column index, starting at 1 - * @return true if the indexed column is searchable, false otherwise. + * the column index, starting at 1. + * @return {@code true} if the indexed column is searchable, {@code false} + * otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isSearchable(int column) throws SQLException; /** - * Returns an indicator of whether the values contained in the indexed + * Returns an indication of whether the values contained in the indexed * column are signed. * * @param column - * the column index, starting at 1 - * @return true if they are signed, false otherwise + * the column index, starting at 1. + * @return {@code true} if they are signed, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isSigned(int column) throws SQLException; @@ -268,10 +301,11 @@ public interface ResultSetMetaData { * possible. * * @param column - * the column index, starting at 1 - * @return true if it is possible to write, false otherwise + * the column index, starting at 1. + * @return {@code true} if it is possible to write, {@code false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean isWritable(int column) throws SQLException; } diff --git a/sql/src/main/java/java/sql/SQLData.java b/sql/src/main/java/java/sql/SQLData.java index 7b07835..cae9d15 100644 --- a/sql/src/main/java/java/sql/SQLData.java +++ b/sql/src/main/java/java/sql/SQLData.java @@ -18,89 +18,106 @@ package java.sql; /** - * An interface for the custom mapping of an SQL User Defined Type (UDT) to a - * Java Class. The Java Class object will be added to the Connection's type map - * with the SQL Name of the UDT which it maps. + * An interface for the custom mapping of an SQL <i>User Defined Type</i> (UDT) + * to a Java class. The Java class object is added to the connection's type map + * paired with the SQL name of the corresponding UDT. * <p> - * Usually within an implementation of SQLData, there is a corresponding field - * for every attribute of an SQL type, or only one field if the type is SQL - * DISTINCT. When the UDT is returned within a ResultSet, it is accessed with - * the ResultSet.getObject method and is returned as an Object which is an - * instance of the class defined by the SQLData mapping. The application can use - * this object just like any other Java object and can store changes back into - * the database using the PreparedStatement.setObject method which performs the - * reverse mapping into the SQL UDT. + * Usually within an implementation of {@code SQLData}, there is a corresponding + * field for every attribute of an SQL type, but only one field, if the type is + * SQL {@code DISTINCT}. When the UDT is returned within a {@code ResultSet}, it + * is accessed with the {@link ResultSet#getObject} method and is returned as an + * object which is an instance of the class defined by the {@code SQLData} + * mapping. The application can use this object just like any other Java object + * and can store changes back into the database using the + * {@link PreparedStatement#setObject} method which performs the reverse mapping + * into the SQL {@code UDT}. + * </p> + * Normally the implementation of a custom mapping is generated by + * a tool requiring the name of the SQL {@code UDT}, the name + * of the class which it is going to be mapped to, and the field names to which + * the UDT attributes are mapped. The tool can then implement the {@code + * SQLData}, {@code readSQL}, and {@code writeSQL} methods. {@code readSQL} reads + * attributes from an {@code SQLInput} object, and {@code writeSQL} writes them. + * This is done via {@code SQLInput} and {@code SQLOutput} method calls + * respectively. * <p> - * It is standard for an implementation for a custom mapping to be generated by - * a tool. The tool usually requires the name of the SQL UDT, the name of the - * class which it is going to be mapped to, and the field names to which the UDT - * attributes will be mapped. The tool can then implement the SQLData readSQL - * and writeSQL methods. readSQL reads attributes from an SQLInput object, and - * writeSQL writes them. This is done via SQLInput and SQLOutput method calls - * respectively - * <p> - * Ordinarily a programmer would not call SQLData methods directly. Similarly - * SQLInput and SQLOutput methods are not usually called directly. + * Ordinarily an application would not call {@code SQLData} methods directly. + * Similarly {@code SQLInput} and {@code SQLOutput} methods are not usually + * called directly. + * </p> + * + * @since Android 1.0 */ public interface SQLData { /** - * Gets the SQL name of the User Defined Type (UDT) that this object + * Gets the SQL name of the <i>User Defined Type</i> (UDT) that this object * represents. This method, usually invoked by the JDBC driver, retrieves - * the name of the UDT instance associated with this SQLData object. + * the name of the UDT instance associated with this {@code SQLData} object. * * @return a string with UDT type name for this object mapping, passed to - * readSQL when the object was created + * {@code readSQL} when the object was created. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public String getSQLTypeName() throws SQLException; /** * Reads data from the database into this object. This method follows these * steps: + * <p> * <ul> * <li>Utilize the passed input stream to read the attributes or entries of * the SQL type</li> * <li>This is carried out by reading each entry from the input stream, - * ordered as the are the SQL definition.</li> + * ordered as they are in the SQL definition.</li> * <li>Assign the data to the appropriate fields or elements. This is done - * by calling the relevant reader method for the type involved (eg. - * SQLInput.readString, SQLInputreadBigDecimal). If the type is distinct, - * then read its only data entry. For structured types, read every entry.</li> + * by calling the relevant reader method for the type involved (e.g. {@code + * SQLInput.readString}, {@code SQLInputreadBigDecimal}). If the type is + * distinct, then read its only data entry. For structured types, read every + * entry.</li> * </ul> + * </p> + * <p> * The supplied input stream is typically initialized by the calling JDBC - * driver with the type map before readSQL is called. + * driver with the type map before {@code readSQL} is called. + * </p> * * @param stream - * the SQLInput stream from which the type map data is read for - * the custom mapping + * the {@code SQLInput} stream from which the type map data is + * read for the custom mapping. * @param typeName - * the SQL Type name for the type which is being mapped + * the SQL type name for the type which is being mapped. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see SQLInput + * @since Android 1.0 */ public void readSQL(SQLInput stream, String typeName) throws SQLException; /** - * Writes the object to a supplied SQLOutput data stream, writing it out as - * an SQL value to the data source. + * Writes the object to a supplied {@code SQLOutput} data stream, writing it + * out as an SQL value to the data source. * <p> * This method follows the following steps: * <ul> * <li>Write each attribute of the SQL type to the output stream.</li> * <li>Write each item by calling a method on the output stream, in the * order they appear in the SQL definition of the type. Use the appropriate - * SQLOutput methods (eg. writeInt, writeString). Write a single data - * element for a Distinct type. For a Structured type, write a value for - * each attribute of the the SQL type.</li> + * {@code SQLOutput} methods (e.g. {@code writeInt}, {@code writeString}). + * Write a single data element for a distinct type. For a structured type, + * write a value for each attribute of the the SQL type.</li> * </ul> + * </p> * * @param stream - * the SQLOutput stream to use to write out the data for the - * custom mapping + * the {@code SQLOutput} stream to use to write out the data for + * the custom mapping. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see SQLOutput + * @since Android 1.0 */ public void writeSQL(SQLOutput stream) throws SQLException; } diff --git a/sql/src/main/java/java/sql/SQLException.java b/sql/src/main/java/java/sql/SQLException.java index 07a4763..2cea139 100644 --- a/sql/src/main/java/java/sql/SQLException.java +++ b/sql/src/main/java/java/sql/SQLException.java @@ -20,25 +20,29 @@ package java.sql; import java.io.Serializable; /** - * An Exception class that is used in conjunction with JDBC operations. It - * provides information about problems encountered with Database access and + * An {@code Exception} class that is used in conjunction with JDBC operations. + * It provides information about problems encountered with database access and * other problems related to JDBC * <p> - * The SQLException class provides the following information: + * The {@code SQLException} class provides the following information: * <ul> - * <li>A standard Java exception message, as a String - * <li>An SQLState string. This is an error description string which follows - * either the SQL 99 conventions or the XOPEN SQLstate conventions. The - * potential values of the SQLState string are described in each of the - * specifications. Which of the conventions is being used by the SQLState string - * can be discovered by using the getSQLStateType method of the DatabaseMetaData - * interface. - * <li>An Error Code, an an integer. The error code is specific to each - * database vendor and is typically the error code returned by the database - * itself. - * <li>A chain to a next Exception, if relevant, which can give access to - * additional error information. + * <li>A standard Java exception message, as a {@code String}</li> + * <li>An {@code SQLState} string. This is an error description string which + * follows either the SQL 99 conventions or the X/OPEN {@code SQLstate} + * conventions. The potential values of the {@code SQLState} string are + * described in each of the specifications. Which of the conventions is being + * used by the {@code SQLState} string can be discovered by using the {@code + * getSQLStateType} method of the {@code DatabaseMetaData} interface.</li> + * <li>An error code, an an integer. The error code is specific to each database + * vendor and is typically the error code returned by the database itself.</li> + * <li>A chain to a next {@code Exception}, if relevant, which can give access + * to additional error information.</li> * </ul> + * </p> + * + * @see DatabaseMetaData + * + * @since Android 1.0 */ public class SQLException extends Exception implements Serializable { @@ -51,16 +55,17 @@ public class SQLException extends Exception implements Serializable { private SQLException next = null; /** - * Creates an SQLException object. The Reason string is set to null, the - * SQLState string is set to null and the Error Code is set to 0. + * Creates an {@code SQLException} object. The reason string is set to + * {@code null}, the {@code SQLState} string is set to {@code null} and the + * error code is set to 0. */ public SQLException() { super(); } /** - * Creates an SQLException object. The Reason string is set to the given - * reason string, the SQLState string is set to null and the Error Code is + * Creates an {@code SQLException} object. The reason string is set to the given + * reason string, the {@code SQLState} string is set to {@code null} and the error code is * set to 0. * * @param theReason @@ -71,30 +76,33 @@ public class SQLException extends Exception implements Serializable { } /** - * Creates an SQLException object. The Reason string is set to the given - * reason string, the SQLState string is set to the given SQLState string - * and the Error Code is set to 0. + * Creates an {@code SQLException} object. The reason string is set to the + * given reason string, the {@code SQLState} string is set to the given + * {@code SQLState} string and the error code is set to 0. * * @param theReason - * the string to use as the Reason string + * the string to use as the reason string. * @param theSQLState - * the string to use as the SQLState string + * the string to use as the {@code SQLState} string. + * @since Android 1.0 */ public SQLException(String theReason, String theSQLState) { this(theReason, theSQLState, 0); } /** - * Creates an SQLException object. The Reason string is set to the given - * reason string, the SQLState string is set to the given SQLState string - * and the Error Code is set to the given error code value. + * Creates an {@code SQLException} object. The reason string is set to the + * given reason string, the {@code SQLState} string is set to the given + * {@code SQLState} string and the error code is set to the given error code + * value. * * @param theReason - * the string to use as the Reason string + * the string to use as the reason string. * @param theSQLState - * the string to use as the SQLState string + * the string to use as the {@code SQLState} string. * @param theErrorCode - * the integer value for the error code + * the integer value for the error code. + * @since Android 1.0 */ public SQLException(String theReason, String theSQLState, int theErrorCode) { super(theReason); @@ -103,45 +111,52 @@ public class SQLException extends Exception implements Serializable { } /** - * Returns the integer error code for this SQLException + * Returns the integer error code for this {@code SQLException}. * - * @return The integer error code for this SQLException. The meaning of the - * code is specific to the vendor of the database. + * @return The integer error code for this {@code SQLException}. The meaning + * of the code is specific to the vendor of the database. + * @since Android 1.0 */ public int getErrorCode() { return vendorCode; } /** - * Retrieves the SQLException chained to this SQLException, if any. + * Retrieves the {@code SQLException} chained to this {@code SQLException}, + * if any. * - * @return The SQLException chained to this SQLException. null if there is - * no SQLException chained to this SQLException. + * @return The {@code SQLException} chained to this {@code SQLException}. + * {@code null} if there is no {@code SQLException} chained to this + * {@code SQLException}. */ public SQLException getNextException() { return next; } /** - * Retrieves the SQLState description string for this SQLException object + * Retrieves the {@code SQLState} description string for this {@code + * SQLException} object. * - * @return The SQLState string for this SQLException object. This is an - * error description string which follows either the SQL 99 - * conventions or the XOPEN SQLstate conventions. The potential - * values of the SQLState string are described in each of the - * specifications. Which of the conventions is being used by the - * SQLState string can be discovered by using the getSQLStateType - * method of the DatabaseMetaData interface. + * @return The {@code SQLState} string for this {@code SQLException} object. + * This is an error description string which follows either the SQL + * 99 conventions or the X/OPEN {@code SQLstate} conventions. The + * potential values of the {@code SQLState} string are described in + * each of the specifications. Which of the conventions is being + * used by the {@code SQLState} string can be discovered by using + * the {@code getSQLStateType} method of the {@code + * DatabaseMetaData} interface. */ public String getSQLState() { return SQLState; } /** - * Adds the SQLException to the end of this SQLException chain. + * Adds the SQLException to the end of this {@code SQLException} chain. * * @param ex - * the new SQLException to be added to the end of the chain + * the new {@code SQLException} to be added to the end of the + * chain. + * @since Android 1.0 */ public void setNextException(SQLException ex) { if (next != null) { diff --git a/sql/src/main/java/java/sql/SQLInput.java b/sql/src/main/java/java/sql/SQLInput.java index d30da9f..b72c839 100644 --- a/sql/src/main/java/java/sql/SQLInput.java +++ b/sql/src/main/java/java/sql/SQLInput.java @@ -23,258 +23,319 @@ import java.io.InputStream; import java.net.URL; /** - * The SQLInput interface defines operations which apply to a type of input - * stream which carries a series of values which represent an instance of an SQL - * structured type or SQL distinct type. + * The {@code SQLInput} interface defines operations which apply to a type of + * input stream which carries a series of values representing an instance of + * an SQL structured type or SQL distinct type. * <p> - * SQLInput interface is used for custom mapping of SQL User Defined Types - * (UDTs)to Java classes. It is used by JDBC drivers below the level of the - * public interfaces and application programs do not normally use the SQLInput - * methods directly. Reader methods such as readLong and readBytes provide means - * to read values from an SQLInput stream. - * <p> - * When the getObject method is called with an object which implements the - * SQLData interface, the JDBC driver determines the SQL type of the UDT being - * mapped by calling the SQLData.getSQLType method. The driver creates an - * instance of an SQLInput stream, filling the stream with the attributes of the - * UDT. The SQLInput stream is passed to the SQLData.readSQL method which then - * calls the SQLInput reader methods to read the attributes. + * This interface is used to define custom mappings of SQL <i>User Defined + * Types</i> (UDTs) to Java classes. It is used by JDBC drivers, therefore + * application programmers do not normally use the {@code SQLInput} methods + * directly. Reader methods such as {@code readLong} and {@code readBytes} + * provide means to read values from an {@code SQLInput} stream. + * </p><p> + * When the {@code getObject} method is called with an object which implements + * the {@code SQLData} interface, the JDBC driver determines the SQL type of the + * UDT being mapped by calling the {@code SQLData.getSQLType} method. The driver + * creates an instance of an {@code SQLInput} stream, filling the stream with + * the attributes of the UDT. The {@code SQLInput} stream is passed to the + * {@code SQLData.readSQL} method which then calls the {@code SQLInput} reader + * methods to read the attributes. + * </p> + * + * @see SQLData + * + * @since Android 1.0 */ public interface SQLInput { /** - * Returns the next attribute in the stream in the form of a String. + * Returns the next attribute in the stream in the form of a {@code String}. + * + * @return the next attribute. {@code null} if the value is SQL {@code NULL}. * - * @return the next attribute as a String. null if the value is SQL NULL. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public String readString() throws SQLException; /** - * Returns the next attribute in the stream in the form of a boolean. + * Returns the next attribute in the stream in the form of a {@code boolean} + * . * - * @return the next attribute as a boolean. false if the value is SQL NULL. + * @return the next attribute as a {@code boolean}. {@code false} if the + * value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean readBoolean() throws SQLException; /** - * Returns the next attribute in the stream in the form of a byte. + * Returns the next attribute in the stream in the form of a {@code byte}. * - * @return the next attribute as a byte. 0 if the value is SQL NULL. + * @return the next attribute as a {@code byte}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public byte readByte() throws SQLException; /** - * Returns the next attribute in the stream in the form of a short. + * Returns the next attribute in the stream in the form of a {@code short}. * - * @return the next attribute as a short. 0 if the value is SQL NULL. + * @return the next attribute as a {@code short}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public short readShort() throws SQLException; /** - * Returns the next attribute in the stream in the form of an int. + * Returns the next attribute in the stream in the form of an {@code int}. * - * @return the next attribute as an int. 0 if the value is SQL NULL. + * @return the next attribute as an {@code int}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public int readInt() throws SQLException; /** - * Returns the next attribute in the stream in the form of a long. + * Returns the next attribute in the stream in the form of a {@code long}. * - * @return the next attribute as a long. 0 if the value is SQL NULL. + * @return the next attribute as a {@code long}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public long readLong() throws SQLException; /** - * Returns the next attribute in the stream in the form of a float. + * Returns the next attribute in the stream in the form of a {@code float}. * - * @return the next attribute as a float. 0 if the value is SQL NULL. + * @return the next attribute as a {@code float}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public float readFloat() throws SQLException; /** - * Returns the next attribute in the stream in the form of a double. + * Returns the next attribute in the stream in the form of a {@code double}. * - * @return the next attribute as a double. 0 if the value is SQL NULL. + * @return the next attribute as a {@code double}. 0 if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public double readDouble() throws SQLException; /** - * Returns the next attribute in the stream in the form of a - * java.math.BigDecimal. + * Returns the next attribute in the stream in the form of a {@code + * java.math.BigDecimal}. * - * @return the attribute as a java.math.BigDecimal. null if the read returns - * SQL NULL. + * @return the attribute as a {@code java.math.BigDecimal}. {@code null} if + * the read returns SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see java.math.BigDecimal + * @since Android 1.0 */ public BigDecimal readBigDecimal() throws SQLException; /** * Returns the next attribute in the stream in the form of a byte array. * - * @return the attribute as a byte array. null if the read returns SQL NULL. + * @return the attribute as a byte array. {@code null} if the read returns + * SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public byte[] readBytes() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Date. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Date}. * - * @return the next attribute as a java.sql.Date. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.sql.Date}. {@code null} if + * the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Date + * @since Android 1.0 */ public Date readDate() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Time. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Time}. * - * @return the attribute as a java.sql.Time. null if the read returns SQL - * NULL. + * @return the attribute as a {@code java.sql.Time}. {@code null} if the + * read returns SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Time + * @since Android 1.0 */ public Time readTime() throws SQLException; /** - * Returns the next attribute in the stream in the form of a - * java.sql.Timestamp. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Timestamp}. * - * @return the attribute as a java.sql.Timestamp. null if the read returns - * SQL NULL. + * @return the attribute as a {@code java.sql.Timestamp}. {@code null} if + * the read returns SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Timestamp + * @since Android 1.0 */ public Timestamp readTimestamp() throws SQLException; /** * Returns the next attribute in the stream in the form of a Unicode - * character stream embodied as a java.io.Reader. + * character stream embodied as a {@code java.io.Reader}. * - * @return the next attribute as a java.io.Reader. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.io.Reader}. {@code null} if + * the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see java.io.Reader + * @since Android 1.0 */ public Reader readCharacterStream() throws SQLException; /** * Returns the next attribute in the stream in the form of an ASCII - * character stream embodied as a java.io.InputStream. + * character stream embodied as a {@code java.io.InputStream}. * - * @return the next attribute as a java.io.InputStream. null if the value is - * SQL NULL. + * @return the next attribute as a {@code java.io.InputStream}. {@code null} + * if the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see java.io.InputStream + * @since Android 1.0 */ public InputStream readAsciiStream() throws SQLException; /** * Returns the next attribute in the stream in the form of a stream of bytes - * embodied as a java.io.InputStream. + * embodied as a {@code java.io.InputStream}. * - * @return the next attribute as a java.io.InputStream. null if the value is - * SQL NULL. + * @return the next attribute as a {@code java.io.InputStream}. {@code null} + * if the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see java.io.InputStream + * @since Android 1.0 */ public InputStream readBinaryStream() throws SQLException; /** - * Returns the next attribute in the stream in the form of a - * java.lang.Object. + * Returns the next attribute in the stream in the form of a {@code + * java.lang.Object}. * <p> - * The type of the Object returned is determined by the type mapping for - * this JDBC driver, including any customized mappings in force. A type map - * is given to the SQLInput by the JDBC driver before the SQLInput is given - * to the application. + * The type of the {@code Object} returned is determined by the type mapping + * for this JDBC driver, including any customized mappings, if present. A + * type map is given to the {@code SQLInput} by the JDBC driver before the + * {@code SQLInput} is given to the application. + * </p> * <p> * If the attribute is an SQL structured or distinct type, its SQL type is - * determined. If the streams type map contains an element for that SQL - * type, the driver creates an object of relevant type and invokes the - * method SQLData.readSQL on it, which reads supplementary data from the - * stream using whichever protocol is defined for that method. + * determined. If the stream's type map contains an element for that SQL + * type, the driver creates an object for the relevant type and invokes the + * method {@code SQLData.readSQL} on it, which reads supplementary data from + * the stream using whichever protocol is defined for that method. + * </p> * - * @return the next attribute as an Object. null if the value is SQL NULL. + * @return the next attribute as an Object. {@code null} if the value is SQL + * {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public Object readObject() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Ref. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Ref}. * - * @return the next attribute as a java.sql.Ref. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.sql.Ref}. {@code null} if the + * value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Ref + * @since Android 1.0 */ public Ref readRef() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Blob. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Blob}. * - * @return the next attribute as a java.sql.Blob. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.sql.Blob}. {@code null} if + * the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public Blob readBlob() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Clob. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Clob}. * - * @return the next attribute as a java.sql.Clob. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.sql.Clob}. {@code null} if + * the value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Clob + * @since Android 1.0 */ public Clob readClob() throws SQLException; /** - * Returns the next attribute in the stream in the form of a java.sql.Array. + * Returns the next attribute in the stream in the form of a {@code + * java.sql.Array}. * - * @return the next attribute as an Array. null if the value is SQL NULL. + * @return the next attribute as an {@code Array}. {@code null} if the value + * is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see Array + * @since Android 1.0 */ public Array readArray() throws SQLException; /** - * Reports whether the last value read was SQL NULL. + * Reports whether the last value read was SQL {@code NULL}. * - * @return true if the last value read was SQL NULL, false otherwise. + * @return {@code true} if the last value read was SQL {@code NULL}, {@code + * false} otherwise. * @throws SQLException - * if there is a database error + * if there is a database error. + * @since Android 1.0 */ public boolean wasNull() throws SQLException; /** * Reads the next attribute in the stream (SQL DATALINK value) and returns - * it as a java.net.URL object. + * it as a {@code java.net.URL} object. * - * @return the next attribute as a java.net.URL. null if the value is SQL - * NULL. + * @return the next attribute as a {@code java.net.URL}. {@code null} if the + * value is SQL {@code NULL}. * @throws SQLException - * if there is a database error + * if there is a database error. + * @see java.net.URL + * @since Android 1.0 */ public URL readURL() throws SQLException; } diff --git a/sql/src/main/java/java/sql/SQLOutput.java b/sql/src/main/java/java/sql/SQLOutput.java index 287a5f6..9fded5e 100644 --- a/sql/src/main/java/java/sql/SQLOutput.java +++ b/sql/src/main/java/java/sql/SQLOutput.java @@ -23,108 +23,122 @@ import java.math.BigDecimal; import java.net.URL; /** - * The interface for an output stream used to write attributes of an SQL User - * Defined Type to the database. This interface is used for custom mapping of - * types and is called by the JDBC driver. It is not expected that this - * interface is used by applications. + * The interface for an output stream used to write attributes of an SQL <i>User + * Defined Type</i> (UDT) to the database. This interface is used for custom + * mapping of types and is called by the JDBC driver. It is not intended to be + * used by applications. * <p> - * When an object which implements the SQLData interface is used as an argument - * to an SQL statement, the JDBC driver calls the method - * <code>SQLData.getSQLType</code> to establish the type of the SQL UDT that - * is being passed. The driver then creates an SQLOutput stream and passes it to - * the <code>SQLData.writeSQL</code> method, which in turn uses the - * appropriate SQLOutput writer methods to write the data from the SQLData + * When an object which implements the {@code SQLData} interface is used as an + * argument to an SQL statement, the JDBC driver calls the method {@code + * SQLData.getSQLType} to establish the type of the SQL UDT that is being + * passed. The driver then creates an {@code SQLOutput} stream and passes it to + * the {@code SQLData.writeSQL} method, which in turn uses the appropriate + * {@code SQLOutput} writer methods to write the data from the {@code SQLData} * object into the stream according to the defined mapping. + * </p> + * + * @see SQLData + * + * @since Android 1.0 */ public interface SQLOutput { /** - * Write a String value into the output stream. + * Write a {@code String} value into the output stream. * * @param theString - * the String to write + * the {@code String} to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeString(String theString) throws SQLException; /** - * Write a boolean value into the output stream. + * Write a {@code boolean} value into the output stream. * * @param theFlag - * the boolean value to write + * the {@code boolean} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeBoolean(boolean theFlag) throws SQLException; /** - * Write a byte value into the output stream. + * Write a {@code byte} value into the output stream. * * @param theByte - * the byte value to write + * the {@code byte} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeByte(byte theByte) throws SQLException; /** - * Write a short value into the output stream. + * Write a {@code short} value into the output stream. * * @param theShort - * the short value to write + * the {@code short} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeShort(short theShort) throws SQLException; /** - * Write an int value into the output stream. + * Write an {@code int} value into the output stream. * * @param theInt - * the int value to write + * the {@code int} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeInt(int theInt) throws SQLException; /** - * Write a long value into the output stream. + * Write a {@code long} value into the output stream. * * @param theLong - * the long value to write + * the {@code long} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeLong(long theLong) throws SQLException; /** - * Write a float value into the output stream. + * Write a {@code float} value into the output stream. * * @param theFloat - * the float value to write + * the {@code float} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeFloat(float theFloat) throws SQLException; /** - * Write a double value into the output stream. + * Write a {@code double} value into the output stream. * * @param theDouble - * the double value to write + * the {@code double} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeDouble(double theDouble) throws SQLException; /** - * Write a java.math.BigDecimal value into the output stream. + * Write a {@code java.math.BigDecimal} value into the output stream. * * @param theBigDecimal - * the BigDecimal value to write + * the {@code BigDecimal} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeBigDecimal(BigDecimal theBigDecimal) throws SQLException; @@ -132,50 +146,58 @@ public interface SQLOutput { * Write an array of bytes into the output stream. * * @param theBytes - * the array of bytes to write + * the array of bytes to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeBytes(byte[] theBytes) throws SQLException; /** - * Write a java.sql.Date value into the output stream. + * Write a {@code java.sql.Date} value into the output stream. * * @param theDate - * the Date value to write + * the {@code Date} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Date + * @since Android 1.0 */ public void writeDate(Date theDate) throws SQLException; /** - * Write a java.sql.Time value into the output stream. + * Write a {@code java.sql.Time} value into the output stream. * * @param theTime - * the Time value to write + * the {@code Time} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Time + * @since Android 1.0 */ public void writeTime(Time theTime) throws SQLException; /** - * Write a java.sql.Timestamp value into the output stream. + * Write a {@code java.sql.Timestamp} value into the output stream. * * @param theTimestamp - * the Timestamp value to write + * the {@code Timestamp} value to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Timestamp + * @since Android 1.0 */ public void writeTimestamp(Timestamp theTimestamp) throws SQLException; /** - * Write a stream of Unicode characters into the output stream. + * Write a stream of unicode characters into the output stream. * * @param theStream - * the stream of Unicode characters to write, as a java.io.Reader - * object + * the stream of unicode characters to write, as a {@code + * java.io.Reader} object. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeCharacterStream(Reader theStream) throws SQLException; @@ -183,10 +205,11 @@ public interface SQLOutput { * Write a stream of ASCII characters into the output stream. * * @param theStream - * the stream of ASCII characters to write, as a - * java.io.InputStream object + * the stream of ASCII characters to write, as a {@code + * java.io.InputStream} object * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeAsciiStream(InputStream theStream) throws SQLException; @@ -194,87 +217,105 @@ public interface SQLOutput { * Write a stream of uninterpreted bytes into the output stream. * * @param theStream - * the stream of bytes to write, as a java.io.InputStream object + * the stream of bytes to write, as a {@code java.io.InputStream} + * object * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public void writeBinaryStream(InputStream theStream) throws SQLException; /** - * Write an SQLData object into the output stream. + * Write an {@code SQLData} object into the output stream. * <p> - * If the SQLData object is null, writes SQL NULL to the stream. + * If the {@code SQLData} object is null, writes {@code NULL} to the stream. + * </p> * <p> - * Otherwise, calls the <code>SQLData.writeSQL</code> method of the - * object, which writes the object's attributes to the stream by calling the - * appropriate SQLOutput writer methods for each attribute, in order. The - * order of the attributes is the order they are listed in the SQL - * definition of the User Defined Type. + * Otherwise, calls the {@code SQLData.writeSQL} method of the object, which + * writes the object's attributes to the stream by calling the appropriate + * SQLOutput writer methods for each attribute, in order. The order of the + * attributes is the order they are listed in the SQL definition of the User + * Defined Type. + * </p> * * @param theObject - * the SQLData object to write + * the {@code SQLData} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see SQLData + * @since Android 1.0 */ public void writeObject(SQLData theObject) throws SQLException; /** - * Write an SQL Ref value into the output stream. + * Write an SQL {@code Ref} value into the output stream. * * @param theRef - * the java.sql.Ref object to write + * the {@code java.sql.Ref} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Ref + * @since Android 1.0 */ public void writeRef(Ref theRef) throws SQLException; /** - * Write an SQL Blob value into the output stream. + * Write an SQL {@code Blob} value into the output stream. * * @param theBlob - * the java.sql.Blob object to write + * the {@code java.sql.Blob} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Blob + * @since Android 1.0 */ public void writeBlob(Blob theBlob) throws SQLException; /** - * Write an SQL Clob value into the output stream. + * Write an SQL {@code Clob} value into the output stream. * * @param theClob - * the java.sql.Clob object to write + * the {@code java.sql.Clob} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Clob + * @since Android 1.0 */ public void writeClob(Clob theClob) throws SQLException; /** - * Write an SQL Struct value into the output stream. + * Write an SQL {@code Struct} value into the output stream. * * @param theStruct - * the java.sql.Struct object to write + * the {@code java.sql.Struct} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Struct + * @since Android 1.0 */ public void writeStruct(Struct theStruct) throws SQLException; /** - * Write an SQL Array value into the output stream. + * Write an SQL {@code Array} value into the output stream. * * @param theArray - * the java.sql.Array object to write + * the {@code java.sql.Array} object to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see Array + * @since Android 1.0 */ public void writeArray(Array theArray) throws SQLException; /** - * Write an SQL DATALINK value into the output stream. + * Write an SQL {@code DATALINK} value into the output stream. * * @param theURL - * the Datalink value as a java.net.URL to write + * the datalink value as a {@code java.net.URL} to write. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @see java.net.URL + * @since Android 1.0 */ public void writeURL(URL theURL) throws SQLException; } diff --git a/sql/src/main/java/java/sql/SQLPermission.java b/sql/src/main/java/java/sql/SQLPermission.java index 734f1f2..a9f82d1 100644 --- a/sql/src/main/java/java/sql/SQLPermission.java +++ b/sql/src/main/java/java/sql/SQLPermission.java @@ -22,13 +22,20 @@ import java.security.BasicPermission; import java.security.Guard; /** - * Permission relating to security access control in the java.sql package. + * A Permission relating to security access control in the {@code java.sql} + * package. * <p> - * Currently, the only permission supported has the name "setLog". The setLog - * permission controls whether a Java application or applet can open a logging - * stream using the DriverManager.setLogWriter method or the - * DriverManager.setLogStream method. This is a potentially dangerous operation - * since the logging stream can contain usernames, passwords + * Currently, the only permission supported has the name " {@code setLog}". The + * {@code setLog} permission controls whether a Java application or applet can + * open a logging stream using the {@code DriverManager.setLogWriter} method or + * the {@code DriverManager.setLogStream} method. This is a potentially + * dangerous operation since the logging stream can contain sensitive + * information such as usernames and passwords. + * </p> + * + * @see DriverManager + * + * @since Android 1.0 */ public final class SQLPermission extends BasicPermission implements Guard, Serializable { @@ -36,23 +43,23 @@ public final class SQLPermission extends BasicPermission implements Guard, private static final long serialVersionUID = -1439323187199563495L; /** - * Creates a new SQLPermission object with the specified name. + * Creates a new {@code SQLPermission} object with the specified name. * * @param name - * the name to use for this SQLPermission + * the name to use for this {@code SQLPermission}. */ public SQLPermission(String name) { super(name); } /** - * Creates a new SQLPermission object with the specified name. + * Creates a new {@code SQLPermission} object with the specified name. * * @param name - * is the name of the SQLPermission. Currently only "setLog" is - * allowed. + * is the name of the {@code SQLPermission}. Currently only + * {@code "setLog"} is allowed. * @param actions - * is currently unused and should be set to null + * is currently unused and should be set to {@code null}. */ public SQLPermission(String name, String actions) { super(name, null); diff --git a/sql/src/main/java/java/sql/SQLWarning.java b/sql/src/main/java/java/sql/SQLWarning.java index efaf216..de94da5 100644 --- a/sql/src/main/java/java/sql/SQLWarning.java +++ b/sql/src/main/java/java/sql/SQLWarning.java @@ -23,62 +23,76 @@ import org.apache.harmony.sql.internal.nls.Messages; /** * An exception class that holds information about Database access warnings. + * + * @since Android 1.0 */ public class SQLWarning extends SQLException implements Serializable { private static final long serialVersionUID = 3917336774604784856L; /** - * Creates an SQLWarning object. The Reason string is set to null, the - * SQLState string is set to null and the Error Code is set to 0. + * Creates an {@code SQLWarning} object. The reason string is set to {@code + * null}, the {@code SQLState} string is set to {@code null} and the error + * code is set to 0. + * + * @since Android 1.0 */ public SQLWarning() { super(); } /** - * Creates an SQLWarning object. The Reason string is set to the given - * reason string, the SQLState string is set to null and the Error Code is - * set to 0. + * Creates an {@code SQLWarning} object. The reason string is set to the + * given reason string, the {@code SQLState} string is set to {@code null} + * and the error code is set to 0. * * @param theReason + * the reason why this warning is issued. + * @since Android 1.0 */ public SQLWarning(String theReason) { super(theReason); } /** - * Creates an SQLWarning object. The Reason string is set to the given - * reason string, the SQLState string is set to the given SQLState string - * and the Error Code is set to 0. + * Creates an {@code SQLWarning} object. The reason string is set to the + * given reason string, the {@code SQLState} string is set to the given + * {@code SQLState} string and the error code is set to 0. * * @param theReason - * the string to use as the Reason string + * the reason why this warning is issued. * @param theSQLState - * the string to use as the SQLState string + * the string to use as the {@code SQLState} string. */ public SQLWarning(String theReason, String theSQLState) { super(theReason, theSQLState); } /** - * Creates an SQLWarning object. The Reason string is set to the given - * reason string, the SQLState string is set to the given SQLState string - * and the Error Code is set to the given ErrorCode value. + * Creates an {@code SQLWarning} object. The reason string is set to the + * given reason string, the {@code SQLState} string is set to the given + * {@code SQLState} string and the error code is set to the given error code + * value. * * @param theReason + * the reason why this warning is issued. * @param theSQLState + * the X/Open standard specifc error code. * @param theErrorCode + * a vendor specific error code. + * @since Android 1.0 */ public SQLWarning(String theReason, String theSQLState, int theErrorCode) { super(theReason, theSQLState, theErrorCode); } /** - * Gets the SQLWarning chained to this SQLWarning object. + * Gets the next {@code SQLWarning} chained to this {@code SQLWarning} object. * - * @return the SQLWarning chained to this SQLWarning. null if no SQLWarning - * is chained to this SQLWarning. + * @return the {@code SQLWarning} chained to this {@code SQLWarning}. + * {@code null} if no {@code SQLWarning} is chained to this {@code + * SQLWarning}. + * @since Android 1.0 */ public SQLWarning getNextWarning() { SQLException next = super.getNextException(); @@ -92,10 +106,11 @@ public class SQLWarning extends SQLException implements Serializable { } /** - * Chains a supplied SQLWarning to this SQLWarning. + * Chains a supplied {@code SQLWarning} to this {@code SQLWarning}. * * @param w - * the SQLWarning to chain to this SQLWarning. + * the {@code SQLWarning} linked to this {@code SQLWarning}. + * @since Android 1.0 */ public void setNextWarning(SQLWarning w) { super.setNextException(w); diff --git a/sql/src/main/java/java/sql/Savepoint.java b/sql/src/main/java/java/sql/Savepoint.java index fd27877..42b4a17 100644 --- a/sql/src/main/java/java/sql/Savepoint.java +++ b/sql/src/main/java/java/sql/Savepoint.java @@ -18,26 +18,32 @@ package java.sql; /** - * A Savepoint is an instant during the current transaction that can be utilized - * by a Rollback from the Connection.rollback method. Rolling back to a - * particular Savepoint means that all changes that occurred after that - * Savepoint are removed. + * A savepoint is an instant during the current transaction that can be utilized + * by a rollback via the {@link Connection#rollback} command. Rolling back to a + * particular savepoint means that all changes that occurred after that + * savepoint are undone. + * + * @since Android 1.0 */ public interface Savepoint { /** - * Returns the constructed ID for this Savepoint. + * Returns the constructed ID for this savepoint. * - * @return the ID for this Savepoint. + * @return the ID for this savepoint. * @throws SQLException + * if an error occurrs accessing the database. + * @since Android 1.0 */ public int getSavepointId() throws SQLException; /** - * Returns the name for this Savepoint. + * Returns the name for this savepoint. * - * @return the name of this Savepoint. + * @return the name of this savepoint. * @throws SQLException + * if an error occurrs accessing the database. + * @since Android 1.0 */ public String getSavepointName() throws SQLException; } diff --git a/sql/src/main/java/java/sql/Statement.java b/sql/src/main/java/java/sql/Statement.java index 8896dbf..4985a9e 100644 --- a/sql/src/main/java/java/sql/Statement.java +++ b/sql/src/main/java/java/sql/Statement.java @@ -18,198 +18,241 @@ package java.sql; /** - * Interface used for executing static SQL statements and returning their - * results. - * - * By default, an object implementing the Statement interface can returns - * results as ResultSets. For any given Statement object, only one ResultSet can - * be open at one time. A call to any of the execution methods of Statement will - * cause any previously created ResultSet object for that Statement to be closed - * implicitly. + * Interface used for executing static SQL statements to retrieve query results. + * The resulting table rows are returned as {@code ResultSet}s. For any given + * {@code Statement} object, only one {@code ResultSet} can be opened at one + * time. A call to any of the execution methods of {@code Statement} will cause + * any previously created {@code ResultSet} object for that {@code Statement} to + * be closed implicitly. + * <p> + * To have multiple {@code ResultSet} objects opened concurrently, multiple + * {@code Statement} objects must be created and then executed. + * </p> * <p> - * To have multiple ResultSet objects open concurrently, multiple Statement - * objects must be used. + * To obtain such an executable statement one needs to invoke {@code + * Connection#createStatement}. + * </p> + * + * @see ResultSet + * @see Connection#createStatement + * + * @since Android 1.0 */ public interface Statement { /** - * Passing this constant to getMoreResults implies that all ResultSet - * objects previously kept open should be closed. + * Passing this constant to {@link #getMoreResults} implies that all {@code + * ResultSet} objects previously kept open should be closed. + * + * @since Android 1.0 */ public static final int CLOSE_ALL_RESULTS = 3; /** - * Passing this constant to getMoreResults implies that the current - * ResultSet object should be closed + * Passing this constant to {@link #getMoreResults} implies that the current + * {@code ResultSet} object should be closed. + * + * @since Android 1.0 */ public static final int CLOSE_CURRENT_RESULT = 1; /** * Indicates that an error was encountered during execution of a batch * statement. + * + * @since Android 1.0 */ public static final int EXECUTE_FAILED = -3; /** - * Passing this constant to getMoreResults implies that the current - * ResultSet object should not be closed. + * Passing this constant to <i>getMoreResults</i> implies that the current + * {@code ResultSet} object should not be closed. + * + * @since Android 1.0 */ public static final int KEEP_CURRENT_RESULT = 2; /** * Indicates that generated keys should not be accessible for retrieval. + * + * @since Android 1.0 */ public static final int NO_GENERATED_KEYS = 2; /** * Indicates that generated keys should be accessible for retrieval. + * + * @since Android 1.0 */ public static final int RETURN_GENERATED_KEYS = 1; /** * Indicates that a batch statement was executed with a successful result, * but a count of the number of rows it affected is unavailable. + * + * @since Android 1.0 */ public static final int SUCCESS_NO_INFO = -2; /** - * Adds a specified SQL commands to the list of commands for this Statement. + * Adds a specified SQL command to the list of commands for this {@code + * Statement}. * <p> - * The list of commands is executed by invoking the - * <code>executeBatch</code> method. + * The list of commands is executed by invoking the {@code executeBatch} + * method. + * </p> * * @param sql - * the SQL command as a String. Typically an INSERT or UPDATE - * statement. + * the SQL command as a String. Typically an {@code INSERT} or + * {@code UPDATE} statement. * @throws SQLException * if an error occurs accessing the database or the database - * does not support batch updates + * does not support batch updates. + * @since Android 1.0 */ public void addBatch(String sql) throws SQLException; /** - * Cancels this Statement execution if both the database and the JDBC driver - * support aborting an SQL statement in flight. This method can be used by - * one thread to stop a Statement that is being executed on another thread. + * Cancels this statement's execution if both the database and the JDBC + * driver support aborting an SQL statement in flight. This method can be + * used by one thread to stop a statement that is executed on another + * thread. * * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public void cancel() throws SQLException; /** - * Clears the current list of SQL commands for this Statement. + * Clears the current list of SQL commands for this statement. * * @throws SQLException * if an error occurs accessing the database or the database - * does not support batch updates + * does not support batch updates. + * @since Android 1.0 */ public void clearBatch() throws SQLException; /** - * Clears all SQLWarnings from this Statement. + * Clears all {@code SQLWarnings} from this statement. * * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public void clearWarnings() throws SQLException; /** - * Releases this Statement's database and JDBC driver resources. + * Releases this statement's database and JDBC driver resources. * <p> * Using this method to release these resources as soon as possible is - * strongly recommended. It is not a good idea to rely on these resources - * being released when the Statement object is finalized during garbage - * collection. Doing so can result in unpredictable performance - * characteristics for the application. + * strongly recommended. + * </p> + * <p> + * One should not rely on the resources being automatically released when + * finalized during garbage collection. Doing so can result in unpredictable + * behavior for the application. + * </p> * * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. */ public void close() throws SQLException; /** - * Executes a supplied SQL statement. This may return multiple ResultSets. + * Executes a supplied SQL statement. This may return multiple {@code + * ResultSet}s. * <p> - * Use the <code>getResultSet</code> or <code>getUpdateCount</code> - * methods to get the first result and <code>getMoreResults</code> to get - * any subsequent results. + * Use the {@code getResultSet} or {@code getUpdateCount} methods to get the + * first result and {@code getMoreResults} to get any subsequent results. + * </p> * * @param sql * the SQL statement to execute - * @return true if the first result is a ResultSet, false if the first - * result is an update count or if there is no result + * @return {@code true} if the first result is a {@code ResultSet}, {@code + * false} if the first result is an update count or if there is no + * result. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean execute(String sql) throws SQLException; /** - * Executes a supplied SQL statement. This may return multiple ResultSets. - * This method allows control of whether auto-generated Keys should be made - * available for retrieval, if the SQL statement is an INSERT statement. + * Executes a supplied SQL statement. This may return multiple {@code + * ResultSet}s. This method allows control of whether auto-generated Keys + * should be made available for retrieval, if the SQL statement is an + * {@code INSERT} statement. * <p> - * Use the <code>getResultSet</code> or <code>getUpdateCount</code> - * methods to get the first result and <code>getMoreResults</code> to get - * any subsequent results. + * Use the {@code getResultSet} or {@code getUpdateCount} methods to get the + * first result and {@code getMoreResults} to get any subsequent results. + * </p> * * @param sql - * the SQL statement to execute + * the SQL statement to execute. * @param autoGeneratedKeys * a flag indicating whether to make auto generated keys - * available for retrieval. This parameter must be one of - * Statement.NO_GENERATED_KEYS or Statement.RETURN_GENERATED_KEYS - * @return true if results exists and the first result is a ResultSet, false - * if the first result is an update count or if there is no result + * available for retrieval. This parameter must be one of {@code + * Statement.NO_GENERATED_KEYS} or {@code + * Statement.RETURN_GENERATED_KEYS}. + * @return {@code true} if results exists and the first result is a {@code + * ResultSet}, {@code false} if the first result is an update count + * or if there is no result. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean execute(String sql, int autoGeneratedKeys) throws SQLException; /** - * Executes the supplied SQL statement. This may return multiple ResultSets. - * This method allows retrieval of auto generated keys specified by the - * supplied array of column indexes, if the SQL statement is an INSERT - * statement. + * Executes the supplied SQL statement. This may return multiple {@code + * ResultSet}s. This method allows retrieval of auto generated keys + * specified by the supplied array of column indexes, if the SQL statement + * is an {@code INSERT} statement. * <p> - * Use the <code>getResultSet</code> or <code>getUpdateCount</code> - * methods to get the first result and <code>getMoreResults</code> to get - * any subsequent results. + * Use the {@code getResultSet} or {@code getUpdateCount} methods to get the + * first result and {@code getMoreResults} to get any subsequent results. + * </p> * * @param sql - * the SQL statement to execute + * the SQL statement to execute. * @param columnIndexes * an array of indexes of the columns in the inserted row which - * should be made available for retrieval via the - * <code>getGeneratedKeys</code> method. - * @return true if the first result is a ResultSet, false if the first - * result is an update count or if there is no result + * should be made available for retrieval via the {@code + * getGeneratedKeys} method. + * @return {@code true} if the first result is a {@code ResultSet}, {@code + * false} if the first result is an update count or if there is no + * result. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean execute(String sql, int[] columnIndexes) throws SQLException; /** - * Executes the supplied SQL statement. This may return multiple ResultSets. - * This method allows retrieval of auto generated keys specified by the - * supplied array of column indexes, if the SQL statement is an INSERT - * statement. + * Executes the supplied SQL statement. This may return multiple {@code + * ResultSet}s. This method allows retrieval of auto generated keys + * specified by the supplied array of column indexes, if the SQL statement + * is an {@code INSERT} statement. * <p> - * Use the <code>getResultSet</code> or <code>getUpdateCount</code> - * methods to get the first result and <code>getMoreResults</code> to get - * any subsequent results. + * Use the {@code getResultSet} or {@code getUpdateCount} methods to get the + * first result and {@code getMoreResults} to get any subsequent results. + * </p> * * @param sql - * the SQL statement to execute + * the SQL statement to execute. * @param columnNames * an array of column names in the inserted row which should be - * made available for retrieval via the - * <code>getGeneratedKeys</code> method. - * @return true if the first result is a ResultSet, false if the first - * result is an update count or if there is no result + * made available for retrieval via the {@code getGeneratedKeys} + * method. + * @return {@code true} if the first result is a {@code ResultSet}, {@code + * false} if the first result is an update count or if there is no + * result * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean execute(String sql, String[] columnNames) throws SQLException; @@ -219,57 +262,62 @@ public interface Statement { * update counts, if all the commands execute successfully. * <p> * If one of the commands in the batch fails, this method can throw a - * BatchUpdateException and the JDBC driver may or may not process the - * remaining commands. The JDBC driver must behave consistently with the - * underlying database, either always continuing or never continuing. If the + * {@link BatchUpdateException} and the JDBC driver may or may not process + * the remaining commands. The JDBC driver must behave consistently with the + * underlying database, following the "all or nothing" principle. If the * driver continues processing, the array of results returned contains the * same number of elements as there are commands in the batch, with a - * minimum of one of the elements having the EXECUTE_FAILED value. + * minimum of one of the elements having the {@code EXECUTE_FAILED} value. * * @return an array of update counts, with one entry for each command in the * batch. The elements are ordered according to the order in which * the commands were added to the batch. * <p> * <ol> - * <li> If the value of an element is >=0, the corresponding command - * completed successfully and the value is the update count for that - * command, which is the number of rows in the database affected by - * the command.</li> - * <li> If the value is SUCCESS_NO_INFO, the command completed - * successfully but the number of rows affected is unknown. + * <li>If the value of an element is ≥ 0, the corresponding + * command completed successfully and the value is the <i>update + * count</i> (the number of rows in the database affected by the + * command) for that command.</li> + * <li>If the value is {@code SUCCESS_NO_INFO}, the command + * completed successfully but the number of rows affected is + * unknown. * <li> - * <li> If the value is EXECUTE_FAILED, the command failed. + * <li>If the value is {@code EXECUTE_FAILED}, the command failed. * </ol> * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. */ public int[] executeBatch() throws SQLException; /** - * Executes a supplied SQL statement. Returns a single ResultSet. + * Executes a supplied SQL statement. Returns a single {@code ResultSet}. * * @param sql - * an SQL statement to execute. Typically a SELECT statement - * @return a ResultSet containing the data produced by the SQL statement. - * Never null. + * an SQL statement to execute. Typically a {@code SELECT} + * statement + * @return a {@code ResultSet} containing the data produced by the SQL + * statement. Never null. * @throws SQLException * if an error occurs accessing the database or if the statement - * produces anything other than a single ResultSet + * produces anything other than a single {@code ResultSet}. + * @since Android 1.0 */ public ResultSet executeQuery(String sql) throws SQLException; /** - * Executes the supplied SQL statement. The statement may be an INSERT, - * UPDATE or DELETE statement or a statement which returns nothing. + * Executes the supplied SQL statement. The statement may be an {@code + * INSERT}, {@code UPDATE} or {@code DELETE} statement or a statement which + * returns nothing. * * @param sql - * an SQL statement to execute - an SQL INSERT, UPDATE, DELETE or - * a statement which returns nothing + * an SQL statement to execute - an SQL {@code INSERT}, {@code + * UPDATE}, {@code DELETE} or a statement which returns nothing * @return the count of updated rows, or 0 for a statement that returns * nothing. * @throws SQLException * if an error occurs accessing the database or if the statement - * produces a ResultSet + * produces a {@code ResultSet}. + * @since Android 1.0 */ public int executeUpdate(String sql) throws SQLException; @@ -278,17 +326,20 @@ public interface Statement { * whether auto-generated Keys should be made available for retrieval. * * @param sql - * an SQL statement to execute - an SQL INSERT, UPDATE, DELETE or - * a statement which does not return anything. + * an SQL statement to execute - an SQL {@code INSERT}, {@code + * UPDATE}, {@code DELETE} or a statement which does not return + * anything. * @param autoGeneratedKeys * a flag that indicates whether to allow retrieval of auto - * generated keys. Parameter must be one of - * Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS + * generated keys. Parameter must be one of {@code + * Statement.RETURN_GENERATED_KEYS} or {@code + * Statement.NO_GENERATED_KEYS} * @return the number of updated rows, or 0 if the statement returns * nothing. * @throws SQLException * if an error occurs accessing the database or if the statement - * produces a ResultSet + * produces a {@code ResultSet}. + * @since Android 1.0 */ public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException; @@ -298,17 +349,18 @@ public interface Statement { * generated keys specified by the supplied array of column indexes. * * @param sql - * an SQL statement to execute - an SQL INSERT, UPDATE, DELETE or - * a statement which returns nothing + * an SQL statement to execute - an SQL {@code INSERT}, {@code + * UPDATE}, {@code DELETE} or a statement which returns nothing * @param columnIndexes * an array of indexes of the columns in the inserted row which - * should be made available for retrieval via the - * <code>getGeneratedKeys</code> method. + * should be made available for retrieval via the {@code + * getGeneratedKeys} method. * @return the count of updated rows, or 0 for a statement that returns * nothing. * @throws SQLException * if an error occurs accessing the database or if the statement - * produces a ResultSet + * produces a {@code ResultSet}. + * @since Android 1.0 */ public int executeUpdate(String sql, int[] columnIndexes) throws SQLException; @@ -318,219 +370,251 @@ public interface Statement { * generated keys specified by the supplied array of column names. * * @param sql - * an SQL statement to execute - an SQL INSERT, UPDATE, DELETE or - * a statement which returns nothing + * an SQL statement to execute - an SQL {@code INSERT}, {@code + * UPDATE}, {@code DELETE} or a statement which returns nothing * @param columnNames * an array of column names in the inserted row which should be - * made available for retrieval via the - * <code>getGeneratedKeys</code> method. + * made available for retrieval via the {@code getGeneratedKeys} + * method. * @return the count of updated rows, or 0 for a statement that returns * nothing. * @throws SQLException * if an error occurs accessing the database or if the statement - * produces a ResultSet + * produces a {@code ResultSet}. + * @since Android 1.0 */ public int executeUpdate(String sql, String[] columnNames) throws SQLException; /** - * Gets the Connection that produced this Statement. + * Gets the {@code Connection} object which created this statement. * - * @return the Connection + * @return the {@code Connection} through which this statement is + * transmitted to the database. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public Connection getConnection() throws SQLException; /** - * Gets the default direction for fetching rows for ResultSets generated - * from this Statement. + * Gets the default direction for fetching rows for {@code ResultSet}s + * generated from this statement. * - * @return an integer describing the default fetch direction, one of: - * ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, - * ResultSet.FETCH_UNKNOWN + * @return the default fetch direction, one of: + * <ul> + * <li>ResultSet.FETCH_FORWARD</li> <li>ResultSet.FETCH_REVERSE</li> + * <li>ResultSet.FETCH_UNKNOWN</li> + * </ul> * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getFetchDirection() throws SQLException; /** - * Gets the default number of rows for a fetch for the ResultSet objects - * returned from this Statement. + * Gets the default number of rows for a fetch for the {@code ResultSet} + * objects returned from this statement. * - * @return the default fetch size for ResultSets produced by this Statement + * @return the default fetch size for {@code ResultSet}s produced by this + * statement. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getFetchSize() throws SQLException; /** - * Returns auto generated keys created by executing this Statement. + * Returns auto generated keys created by executing this statement. * - * @return a ResultSet containing the auto generated keys - empty if no keys - * were generated by the Statement + * @return a {@code ResultSet} containing the auto generated keys - empty if + * no keys are generated by this statement. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public ResultSet getGeneratedKeys() throws SQLException; /** - * Gets the maximum number of bytes which can be returned for values from - * Character and Binary values in a ResultSet derived from this Statement. - * This limit applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, - * and LONGVARCHAR types. Any data exceeding the maximum size is abandoned + * Gets the maximum number of bytes which can be returned as values from + * character and binary type columns in a {@code ResultSet} derived from this + * statement. This limit applies to {@code BINARY}, {@code VARBINARY}, + * {@code LONGVARBINARY}, {@code CHAR}, {@code VARCHAR}, and {@code + * LONGVARCHAR} types. Any data exceeding the maximum size is abandoned * without announcement. * - * @return the current size limit, where 0 means that there is no limit + * @return the current size limit, where {@code 0} means that there is no + * limit. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getMaxFieldSize() throws SQLException; /** - * Gets the maximum number of rows that a ResultSet can contain when - * produced from this Statement. If the limit is exceeded, the excess rows + * Gets the maximum number of rows that a {@code ResultSet} can contain when + * produced from this statement. If the limit is exceeded, the excess rows * are discarded silently. * - * @return the current row limit, where 0 means that there is no limit. + * @return the current row limit, where {@code 0} means that there is no + * limit. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getMaxRows() throws SQLException; /** - * Moves to this Statement's next result. Returns true if it is a ResultSet. - * Any current ResultSet objects previously obtained with - * <code>getResultSet()</code> are closed implicitly. + * Moves to this statement's next result. Returns {@code true} if it is a + * {@code ResultSet}. Any current {@code ResultSet} objects previously + * obtained with {@code getResultSet()} are closed implicitly. * - * @return true if the next result is a ResultSet, false if the next result - * is not a ResultSet or if there are no more results. Note that if - * there is no more data, this method will return false and - * <code>getUpdateCount</code> will return -1. + * @return {@code true} if the next result is a {@code ResultSet}, {@code + * false} if the next result is not a {@code ResultSet} or if there + * are no more results. Note that if there is no more data, this + * method will return {@code false} and {@code getUpdateCount} will + * return -1. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean getMoreResults() throws SQLException; /** - * Moves to this Statement's next result. Returns true if the next result is - * a ResultSet. Any current ResultSet objects previously obtained with - * <code>getResultSet()</code> are handled as indicated by a supplied Flag - * parameter. + * Moves to this statement's next result. Returns {@code true} if the next + * result is a {@code ResultSet}. Any current {@code ResultSet} objects + * previously obtained with {@code getResultSet()} are handled as indicated + * by a supplied Flag parameter. * * @param current - * a flag indicating what to do with existing ResultSets. This - * parameter must be one of Statement.CLOSE_ALL_RESULTS, - * Statement.CLOSE_CURRENT_RESULT or - * Statement.KEEP_CURRENT_RESULT. - * @return true if the next result exists and is a ResultSet, false if the - * next result is not a ResultSet or if there are no more results. - * Note that if there is no more data, this method will return false - * and <code>getUpdateCount</code> will return -1. - * @throws SQLException - * if an error occurs accessing the database + * a flag indicating what to do with existing {@code ResultSet}s. + * This parameter must be one of {@code + * Statement.CLOSE_ALL_RESULTS}, {@code + * Statement.CLOSE_CURRENT_RESULT} or {@code + * Statement.KEEP_CURRENT_RESULT}. + * @return {@code true} if the next result exists and is a {@code ResultSet} + * , {@code false} if the next result is not a {@code ResultSet} or + * if there are no more results. Note that if there is no more data, + * this method will return {@code false} and {@code getUpdateCount} + * will return -1. + * @throws SQLException + * if an error occurs accessing the database. + * @since Android 1.0 */ public boolean getMoreResults(int current) throws SQLException; /** - * Gets the timeout value for Statement execution. The JDBC driver will wait - * up to this value for the execution to complete - after the limit is - * exceeded an SQL Exception is thrown. + * Gets the timeout value for the statement's execution time. The JDBC + * driver will wait up to this value for the execution to complete - after + * the limit is exceeded an SQL {@code Exception} is thrown. * - * @return the current Query Timeout value, where 0 indicates that there is - * no current timeout. + * @return the current query timeout value, where {@code 0} indicates that + * there is no current timeout. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getQueryTimeout() throws SQLException; /** * Gets the current result. Should only be called once per result. * - * @return the ResultSet for the current result. null if the result is an - * update count or if there are no more results. + * @return the {@code ResultSet} for the current result. {@code null} if the + * result is an update count or if there are no more results. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public ResultSet getResultSet() throws SQLException; /** - * Gets the concurrency setting for ResultSet objects generated by this - * Statement. + * Gets the concurrency setting for {@code ResultSet} objects generated by + * this statement. * - * @return ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @return {@code ResultSet.CONCUR_READ_ONLY} or {@code + * ResultSet.CONCUR_UPDATABLE}. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getResultSetConcurrency() throws SQLException; /** - * Gets the cursor hold setting for ResultSet objects generated by this - * Statement. + * Gets the cursor hold setting for {@code ResultSet} objects generated by + * this statement. * - * @return ResultSet.HOLD_CURSORS_OVER_COMMIT or - * ResultSet.CLOSE_CURSORS_AT_COMMIT + * @return {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code + * ResultSet.CLOSE_CURSORS_AT_COMMIT} * @throws SQLException - * if there is an error while accessing the database + * if there is an error while accessing the database. + * @since Android 1.0 */ public int getResultSetHoldability() throws SQLException; /** - * Gets the ResultSet type setting for ResultSets derived from this - * Statement. + * Gets the {@code ResultSet} type setting for {@code ResultSet}s derived + * from this statement. * - * @return ResultSet.TYPE_FORWARD_ONLY for a ResultSet where the cursor can - * only move forward, ResultSet.TYPE_SCROLL_INSENSITIVE for a - * ResultSet which is Scrollable but is not sensitive to changes - * made by others, ResultSet.TYPE_SCROLL_SENSITIVE for a ResultSet - * which is Scrollable but is sensitive to changes made by others + * @return {@code ResultSet.TYPE_FORWARD_ONLY} for a {@code ResultSet} where + * the cursor can only move forwards, {@code + * ResultSet.TYPE_SCROLL_INSENSITIVE} for a {@code ResultSet} which + * is scrollable but is not sensitive to changes made by others, + * {@code ResultSet.TYPE_SCROLL_SENSITIVE} for a {@code ResultSet} + * which is scrollable but is sensitive to changes made by others. * @throws SQLException - * if there is an error accessing the database + * if there is an error accessing the database. + * @since Android 1.0 */ public int getResultSetType() throws SQLException; /** - * Gets an update count for the current result if it is not a ResultSet. + * Gets an update count for the current result if it is not a {@code + * ResultSet}. * - * @return the current result as an update count. -1 if the current result - * is a ResultSet or if there are no more results + * @return the current result as an update count. {@code -1} if the current + * result is a {@code ResultSet} or if there are no more results. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public int getUpdateCount() throws SQLException; /** - * Retrieves the first SQLWarning reported by calls on this Statement. - * <p> - * If there are multiple warnings, subsequent warnings are chained to the - * first one. - * <p> - * The chain or warnings is cleared each time the Statement is executed. + * Retrieves the first {@code SQLWarning} reported by calls on this + * statement. If there are multiple warnings, subsequent warnings are + * chained to the first one. The chain of warnings is cleared each time the + * statement is executed. * <p> - * Warnings associated with reads from the ResultSet returned from executing - * a Statement will be attached to the ResultSet, not the Statement object. + * Warnings associated with reads from the {@code ResultSet} returned from + * executing the statement will be attached to the {@code ResultSet}, not the + * statement object. + * </p> * * @return an SQLWarning, null if there are no warnings * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public SQLWarning getWarnings() throws SQLException; /** - * Sets the SQL cursor name. This name is used by subsequent Statement + * Sets the SQL cursor name. This name is used by subsequent statement * execute methods. * <p> * Cursor names must be unique within one Connection. + * </p> * <p> - * With the Cursor name set, it can then be utilized in SQL positioned - * update or delete statements to determine the current row in a ResultSet - * generated from this Statement. The positioned update or delete must be - * done with a different Statement than this one. + * With the cursor name set, it can then be used in SQL positioned + * update or delete statements to determine the current row in a {@code + * ResultSet} generated from this statement. The positioned update or delete + * must be done with a different statement than this one. + * </p> * * @param name - * the Cursor name as a String, + * the Cursor name as a string, * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public void setCursorName(String name) throws SQLException; @@ -539,28 +623,34 @@ public interface Statement { * <p> * If Escape Processing is on, the JDBC driver will do escape substitution * on an SQL statement before sending it for execution. This does not apply - * to PreparedStatements since they are processed when created, before this - * method can be called. + * to {@link PreparedStatement}s since they are processed when created, + * before this method can be called. + * </p> * * @param enable - * true to set escape processing mode on, false to turn it off. + * {@code true} to set escape processing mode <i>on</i>, {@code + * false} to turn it <i>off</i>. * @throws SQLException - * if an error occurs accessing the database + * if an error occurs accessing the database. + * @since Android 1.0 */ public void setEscapeProcessing(boolean enable) throws SQLException; /** * Sets the fetch direction - a hint to the JDBC driver about the direction - * of processing of rows in ResultSets created by this Statement. The - * default fetch direction is FETCH_FORWARD. + * of processing of rows in {@code ResultSet}s created by this statement. + * The default fetch direction is {@code FETCH_FORWARD}. * * @param direction * which fetch direction to use. This parameter should be one of - * ResultSet.FETCH_UNKNOWN, ResultSet.FETCH_FORWARD or - * ResultSet.FETCH_REVERSE + * <ul> + * <li>{@code ResultSet.FETCH_UNKNOWN}</li> + * <li>{@code ResultSet.FETCH_FORWARD}</li> + * <li>{@code ResultSet.FETCH_REVERSE}</li> + * </ul> * @throws SQLException * if there is an error while accessing the database or if the - * fetch direction is unrecognized + * fetch direction is unrecognized. */ public void setFetchDirection(int direction) throws SQLException; @@ -570,51 +660,57 @@ public interface Statement { * application processing. * * @param rows - * the number of rows that should be fetched. 0 tells the driver - * to ignore the hint. Should be less than - * <code>getMaxRows</code> for this statement. Should not be - * negative. + * the number of rows that should be fetched. {@code 0} tells the driver + * to ignore the hint. Should be less than {@code getMaxRows} for + * this statement. Should not be negative. * @throws SQLException * if an error occurs accessing the database, or if the rows * parameter is out of range. + * @since Android 1.0 */ public void setFetchSize(int rows) throws SQLException; /** - * Sets the maximum number of bytes for ResultSet columns that contain - * character or binary values. This applies to BINARY, VARBINARY, - * LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. Any data exceeding - * the maximum size is abandoned without announcement. + * Sets the maximum number of bytes for {@code ResultSet} columns that + * contain character or binary values. This applies to {@code BINARY}, + * {@code VARBINARY}, {@code LONGVARBINARY}, {@code CHAR}, {@code VARCHAR}, + * and {@code LONGVARCHAR} fields. Any data exceeding the maximum size is + * abandoned without announcement. * * @param max - * the maximum field size in bytes. O means "no limit". + * the maximum field size in bytes. {@code 0} means "no limit". * @throws SQLException - * if an error occurs accessing the database or the max value is - * <0. + * if an error occurs accessing the database or the {@code max} + * value is < {@code 0}. + * @since Android 1.0 */ public void setMaxFieldSize(int max) throws SQLException; /** - * Sets the maximum number of rows that any ResultSet can contain. If the - * number of rows exceeds this value, the additional rows are silently - * discarded. + * Sets the maximum number of rows that any {@code ResultSet} can contain. + * If the number of rows exceeds this value, the additional rows are + * silently discarded. * * @param max - * the maximum number of rows. 0 means "no limit". + * the maximum number of rows. {@code 0} means "no limit". * @throws SQLException - * if an error occurs accessing the database or if max <0. + * if an error occurs accessing the database or if max < {@code + * 0}. + * @since Android 1.0 */ public void setMaxRows(int max) throws SQLException; /** * Sets the timeout, in seconds, for queries - how long the driver will - * allow for completion of a Statement execution. If the timeout is - * exceeded, the query will throw an SQLException. + * allow for completion of a statement execution. If the timeout is + * exceeded, the query will throw an {@code SQLException}. * * @param seconds * timeout in seconds. 0 means no timeout ("wait forever") * @throws SQLException - * if an error occurs accessing the database or if seconds <0. + * if an error occurs accessing the database or if seconds < + * {@code 0}. + * @since Android 1.0 */ public void setQueryTimeout(int seconds) throws SQLException; } diff --git a/sql/src/main/java/java/sql/Struct.java b/sql/src/main/java/java/sql/Struct.java index 0404cb7..1167cdf 100644 --- a/sql/src/main/java/java/sql/Struct.java +++ b/sql/src/main/java/java/sql/Struct.java @@ -20,46 +20,53 @@ package java.sql; import java.util.Map; /** - * An interface which provides facilities for mapping an SQL structured type to - * Java. The Struct object has a value for each attribute of the SQL structured - * type + * An interface which provides facilities for manipulating an SQL structured type + * as a Java object. The {@code Struct} object has a value for each attribute of the SQL structured + * type. + * + * @since Android 1.0 */ public interface Struct { /** - * Gets the SQL Type name of the SQL structured type that this Struct - * represents + * Gets the SQL Type name of the SQL structured type that this {@code + * Struct} represents. * - * @return the fully qualified name of SQL structured type + * @return the fully qualified name of SQL structured type. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public String getSQLTypeName() throws SQLException; /** * Gets the values of the attributes of this SQL structured type. This - * method uses the type map associated with the Connection for customized - * type mappings. Where there is no entry in the Type Map which matches the - * this structured type, the JDBC driver uses the standard mapping. + * method uses the type map associated with the {@link Connection} for + * customized type mappings. Where there is no entry in the type mapping + * which matches this structured type, the JDBC driver uses the standard + * mapping. * - * @return an Object array containing the attributes, in order + * @return an {@code Object} array containing the ordered attributes. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public Object[] getAttributes() throws SQLException; /** * Gets the values of the attributes of this SQL structured type. This - * method uses the supplied type map for customized type mappings. Where - * there is no entry in the Type Map which matches the this structured type, - * the JDBC driver uses the default mapping. The Connection type map is - * never utilized by this method. + * method uses the supplied type mapping to determine how to map SQL types + * to their corresponding Java objects. In the + * case where there is no entry in the type mapping which matches this + * structured type, the JDBC driver uses the default mapping. The {@code + * Connection} type map is <i>never</i> utilized by this method. * * @param theMap * a Map describing how SQL Type names are mapped to classes. - * @return an Object array containing the attributes, in order + * @return an Object array containing the ordered attributes,. * @throws SQLException - * if a database error occurs + * if a database error occurs. + * @since Android 1.0 */ public Object[] getAttributes(Map<String, Class<?>> theMap) throws SQLException; diff --git a/sql/src/main/java/java/sql/Time.java b/sql/src/main/java/java/sql/Time.java index 048259d..7fb28e1 100644 --- a/sql/src/main/java/java/sql/Time.java +++ b/sql/src/main/java/java/sql/Time.java @@ -21,31 +21,36 @@ import java.text.SimpleDateFormat; import java.util.Date; /** - * Java representation of an SQL TIME value. Provides functions to aid - * generation and interpretation of JDBC escape format for time values. + * Java representation of an SQL {@code TIME} value. Provides utilities to + * format and parse the time's representation as a String in JDBC escape format. * + * @since Android 1.0 */ public class Time extends Date { private static final long serialVersionUID = 8397324403548013681L; /** - * @deprecated Please use the constructor {@link #Time(long)} Constructs a Time - * object using the supplied values for Hour, Minute and Second. - * The Year, Month and Day elements of the Time object are set - * to 1970, January, 1 reflecting the Epoch (Time in - * milliseconds = 0). - * <p> - * Any attempt to access the Year, Month or Day elements of a - * Time object will result in an IllegalArgumentException. - * <p> - * Result is undefined if any argument is out of bounds. + * Constructs a {@code Time} object using the supplied values for <i>Hour</i>, + * <i>Minute</i> and <i>Second</i>. The <i>Year</i>, <i>Month</i> and + * <i>Day</i> elements of the {@code Time} object are set to the date + * of the Epoch (January 1, 1970). + * <p> + * Any attempt to access the <i>Year</i>, <i>Month</i> or <i>Day</i> + * elements of a {@code Time} object will result in an {@code + * IllegalArgumentException}. + * </p><p> + * The result is undefined if any argument is out of bounds. + * </p> + * + * @deprecated Please use the constructor {@link #Time(long)}. * @param theHour - * a value from 0 - 23 + * a value in the range {@code [0,23]}. * @param theMinute - * a value from 0 - 59 + * a value in the range {@code [0,59]}. * @param theSecond - * a value from 0 - 59 + * a value in the range {@code [0,59]}. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -54,22 +59,25 @@ public class Time extends Date { } /** - * Constructs a Time object using a supplied time specified in milliseconds + * Constructs a {@code Time} object using a supplied time specified in + * milliseconds. * * @param theTime - * a Time specified in milliseconds since the Epoch (January 1st - * 1970, 00:00:00.000) + * a {@code Time} specified in milliseconds since the + * <i>Epoch</i> (January 1st 1970, 00:00:00.000). + * @since Android 1.0 */ public Time(long theTime) { super(theTime); } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Date component. - * @return does not return + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a {@code Date} component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -79,11 +87,12 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Day component. - * @return does not return + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a <i>Day</i> component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -93,11 +102,12 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Month component. - * @return does not return + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a <i>Month</i> component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -107,11 +117,12 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Year component. - * @return does not return + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a <i>Year</i> component. + * @return does not return anything. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -121,10 +132,11 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Date component. + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a {@code Date} component. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -134,10 +146,11 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Month component. + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a <i>Month</i> component. * @throws IllegalArgumentException - * if this method is called + * if this method is called. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -147,10 +160,10 @@ public class Time extends Date { } /** - * @deprecated This method is deprecated and must not be used. An SQL Time - * object does not have a Year component. + * @deprecated This method is deprecated and must not be used. An SQL + * {@code Time} object does not have a <i>Year</i> component. * @throws IllegalArgumentException - * if this method is called + * if this method is called. */ @SuppressWarnings("deprecation") @Deprecated @@ -160,12 +173,14 @@ public class Time extends Date { } /** - * Sets the time for this Time object to the supplied milliseconds value. + * Sets the time for this {@code Time} object to the supplied milliseconds + * value. * * @param time - * A time value expressed as milliseconds since the Epoch. + * A time value expressed as milliseconds since the <i>Epoch</i>. * Negative values are milliseconds before the Epoch. The Epoch - * is January 1 1970, 00:00:00.000 + * is January 1 1970, 00:00:00.000. + * @since Android 1.0 */ @Override public void setTime(long time) { @@ -173,10 +188,12 @@ public class Time extends Date { } /** - * Formats the Time as a String in JDBC escape format: hh:mm:ss + * Formats the {@code Time} as a String in JDBC escape format: {@code + * hh:mm:ss}. * - * @return A String representing the Time value in JDBC escape format: - * HH:mm:ss + * @return A String representing the {@code Time} value in JDBC escape + * format: {@code HH:mm:ss} + * @since Android 1.0 */ @Override public String toString() { @@ -185,18 +202,20 @@ public class Time extends Date { } /** - * Creates a Time object from a String holding a time represented in JDBC - * escape format: hh:mm:ss. + * Creates a {@code Time} object from a string holding a time represented in + * JDBC escape format: {@code hh:mm:ss}. * <p> - * An exception occurs if the input string is not in the form of a time in - * JDBC escape format. + * An exception occurs if the input string does not comply with this format. + * </p> * * @param timeString * A String representing the time value in JDBC escape format: - * hh:mm:ss - * @return The Time object set to a time corresponding to the given time + * {@code hh:mm:ss}. + * @return The {@code Time} object set to a time corresponding to the given + * time. * @throws IllegalArgumentException * if the supplied time string is not in JDBC escape format. + * @since Android 1.0 */ public static Time valueOf(String timeString) { if (timeString == null) { diff --git a/sql/src/main/java/java/sql/Timestamp.java b/sql/src/main/java/java/sql/Timestamp.java index da8fa7a..b526fb3 100644 --- a/sql/src/main/java/java/sql/Timestamp.java +++ b/sql/src/main/java/java/sql/Timestamp.java @@ -25,20 +25,25 @@ import java.util.Date; import org.apache.harmony.sql.internal.nls.Messages; /** - * A Java representation of the SQL TIMESTAMP type. It provides the capability - * to represent the SQL TIMESTAMP nanosecond value, in addition to the regular - * date/time value which has millisecond resolution. + * A Java representation of the SQL {@code TIMESTAMP} type. It provides the + * capability of representing the SQL {@code TIMESTAMP} nanosecond value, in + * addition to the regular date/time value which has millisecond resolution. * <p> - * The Timestamp class consists of a regular Date/Time value, where only the - * integral seconds value is stored, plus a nanoseconds value where the + * The {@code Timestamp} class consists of a regular date/time value, where only + * the integral seconds value is stored, plus a nanoseconds value where the * fractional seconds are stored. - * <p> - * The addition of the nanosecond value field to the Timestamp object makes it - * significantly different from the java.util.Date object which it extends. - * Users should be cautious in their use of Timestamp objects and should not - * assume that they are interchangeable with java.util.Date objects when used - * outside the confines of the java.sql package. + * </p><p> + * The addition of the nanosecond value field to the {@code Timestamp} object + * makes it significantly different from the {@code java.util.Date} object which + * it extends. Users should be aware that {@code Timestamp} objects are not + * interchangable with {@code java.util.Date} objects when used outside the + * confines of the {@code java.sql} package. + * </p> * + * @see Date + * @see Time + * @see java.util.Date + * @since Android 1.0 */ public class Timestamp extends Date { @@ -48,27 +53,29 @@ public class Timestamp extends Date { private int nanos; /** - * @deprecated Please use the constructor {@link #Timestamp(long)} Returns a - * Timestamp corresponding to the time specified by the supplied - * values for Year, Month, Date, Hour, Minutes, Seconds and - * Nanoseconds + * Returns a {@code Timestamp} corresponding to the time specified by the + * supplied values for <i>Year</i>, <i>Month</i>, <i>Date</i>, <i>Hour</i>, + * <i>Minutes</i>, <i>Seconds</i> and <i>Nanoseconds</i>. + * + * @deprecated Please use the constructor {@link #Timestamp(long)}. * @param theYear - * specified as the year minus 1900 + * specified as the year minus 1900. * @param theMonth - * specified as an integer in the range 0 - 11 + * specified as an integer in the range [0,11]. * @param theDate - * specified as an integer in the range 1 - 31 + * specified as an integer in the range [1,31]. * @param theHour - * specified as an integer in the range 0 - 23 + * specified as an integer in the range [0,23]. * @param theMinute - * specified as an integer in the range 0 - 59 + * specified as an integer in the range [0,59]. * @param theSecond - * specified as an integer in the range 0 - 59 + * specified as an integer in the range [0,59]. * @param theNano * which defines the nanosecond value of the timestamp specified - * as an integer in the range 0 - 999,999,999 + * as an integer in the range [0,999'999'999] * @throws IllegalArgumentException - * if any of the parameters is out of range + * if any of the parameters is out of range. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Deprecated @@ -83,12 +90,13 @@ public class Timestamp extends Date { } /** - * Returns a Timestamp object corresponding to the time represented by a - * supplied time value. + * Returns a {@code Timestamp} object corresponding to the time represented + * by a supplied time value. * * @param theTime * a time value in the format of milliseconds since the Epoch - * (January 1 1970 00:00:00.000 GMT) + * (January 1 1970 00:00:00.000 GMT). + * @since Android 1.0 */ public Timestamp(long theTime) { super(theTime); @@ -100,13 +108,14 @@ public class Timestamp extends Date { } /** - * Returns true if this timestamp object is later than the supplied - * timestamp, otherwise returns false. + * Returns {@code true} if this timestamp object is later than the supplied + * timestamp, otherwise returns {@code false}. * * @param theTimestamp - * the timestamp to compare with this timestamp object - * @return true if this timestamp object is later than the supplied - * timestamp, false otherwise + * the timestamp to compare with this timestamp object. + * @return {@code true} if this {@code Timestamp} object is later than the + * supplied timestamp, {@code false} otherwise. + * @since Android 1.0 */ public boolean after(Timestamp theTimestamp) { long thisTime = this.getTime(); @@ -132,13 +141,14 @@ public class Timestamp extends Date { } /** - * Returns true if this timestamp object is earlier than the supplied - * timestamp, otherwise returns false. + * Returns {@code true} if this {@code Timestamp} object is earlier than the + * supplied timestamp, otherwise returns {@code false}. * * @param theTimestamp - * the timestamp to compare with this timestamp object - * @return true if this timestamp object is earlier than the supplied - * timestamp, false otherwise + * the timestamp to compare with this {@code Timestamp} object. + * @return {@code true} if this {@code Timestamp} object is earlier than the + * supplied timestamp, {@code false} otherwise. + * @since Android 1.0 */ public boolean before(Timestamp theTimestamp) { long thisTime = this.getTime(); @@ -164,16 +174,28 @@ public class Timestamp extends Date { } /** - * Compares this Timestamp object with a supplied Timestamp object + * Compares this {@code Timestamp} object with a supplied {@code Timestamp} + * object. * * @param theObject - * the timestamp to compare with this timestamp object, passed in - * as an Object - * @return 0 if the two Timestamp objects are equal in time, a value <0 if - * this Timestamp object is before the supplied Timestamp and a - * value >0 if this Timestamp object is after the supplied Timestamp + * the timestamp to compare with this {@code Timestamp} object, + * passed as an {@code Object}. + * @return <dd> + * <dl> + * {@code 0} if the two {@code Timestamp} objects are equal in time + * </dl> + * <dl> + * a value {@code < 0} if this {@code Timestamp} object is before + * the supplied {@code Timestamp} and a value + * </dl> + * <dl> + * {@code > 0} if this {@code Timestamp} object is after the + * supplied {@code Timestamp} + * </dl> + * </dd> * @throws ClassCastException - * if the supplied object is not a Timestamp object + * if the supplied object is not a {@code Timestamp} object. + * @since Android 1.0 */ @Override public int compareTo(Date theObject) throws ClassCastException { @@ -181,14 +203,22 @@ public class Timestamp extends Date { } /** - * Compares this Timestamp object with a supplied Timestamp object + * Compares this {@code Timestamp} object with a supplied {@code Timestamp} + * object. * * @param theTimestamp - * the timestamp to compare with this timestamp object, passed in - * as a Timestamp - * @return 0 if the two Timestamp objects are equal in time, a value <0 if - * this Timestamp object is before the supplied Timestamp and a - * value >0 if this Timestamp object is after the supplied Timestamp + * the timestamp to compare with this {@code Timestamp} object, + * passed in as a {@code Timestamp}. + * @return one of the following: + * <ul> + * <li>{@code 0}, if the two {@code Timestamp} objects are + * equal in time</li> + * <li>{@code < 0}, if this {@code Timestamp} object is before the + * supplied {@code Timestamp}</li> + * <li> {@code > 0}, if this {@code Timestamp} object is after the + * supplied {@code Timestamp}</li> + * </ul> + * @since Android 1.0 */ public int compareTo(Timestamp theTimestamp) { int result = super.compareTo(theTimestamp); @@ -210,9 +240,12 @@ public class Timestamp extends Date { * Tests to see if this timestamp is equal to a supplied object. * * @param theObject - * @return true if this Timestamp object is equal to the supplied Timestamp - * object false if the object is not a Timestamp object or if the - * object is a Timestamp but represents a different instant in time + * the object to which this timestamp is compared. + * @return {@code true} if this {@code Timestamp} object is equal to the + * supplied {@code Timestamp} object<br>{@code false} if the object + * is not a {@code Timestamp} object or if the object is a {@code + * Timestamp} but represents a different instant in time. + * @since Android 1.0 */ @Override public boolean equals(Object theObject) { @@ -226,10 +259,11 @@ public class Timestamp extends Date { * Tests to see if this timestamp is equal to a supplied timestamp. * * @param theTimestamp - * the timestamp to compare with this timestamp object, passed in - * as an Object - * @return true if this Timestamp object is equal to the supplied Timestamp - * object + * the timestamp to compare with this {@code Timestamp} object, + * passed as an {@code Object}. + * @return {@code true} if this {@code Timestamp} object is equal to the + * supplied {@code Timestamp} object, {@code false} otherwise. + * @since Android 1.0 */ public boolean equals(Timestamp theTimestamp) { if (theTimestamp == null) { @@ -240,19 +274,24 @@ public class Timestamp extends Date { } /** - * Gets this Timestamp's nanosecond value + * Gets this {@code Timestamp}'s nanosecond value * * @return The timestamp's nanosecond value, an integer between 0 and - * 999,999,999 + * 999,999,999. + * @since Android 1.0 */ public int getNanos() { return nanos; } /** - * Returns the time represented by this Timestamp object, as a long value - * containing the number of milliseconds since the Epoch (January 1 1970, - * 00:00:00.000 GMT) + * Returns the time represented by this {@code Timestamp} object, as a long + * value containing the number of milliseconds since the Epoch (January 1 + * 1970, 00:00:00.000 GMT). + * + * @return the number of milliseconds that have passed since January 1 1970, + * 00:00:00.000 GMT. + * @since Android 1.0 */ @Override public long getTime() { @@ -262,10 +301,14 @@ public class Timestamp extends Date { } /** - * Sets the nanosecond value for this timestamp - * @param n number of nanoseconds - * @throws IllegalArgumentException if number of nanoseconds smaller than 0 - * or greater than 999999999 + * Sets the nanosecond value for this {@code Timestamp}. + * + * @param n + * number of nanoseconds. + * @throws IllegalArgumentException + * if number of nanoseconds smaller than 0 or greater than + * 999,999,999. + * @since Android 1.0 */ public void setNanos(int n) throws IllegalArgumentException { if ((n < 0) || (n > 999999999)) { @@ -276,9 +319,14 @@ public class Timestamp extends Date { } /** - * Sets the time represented by this Timestamp object to the supplied time, - * defined as the number of milliseconds since the Epoch (January 1 1970, - * 00:00:00.000 GMT) + * Sets the time represented by this {@code Timestamp} object to the + * supplied time, defined as the number of milliseconds since the Epoch + * (January 1 1970, 00:00:00.000 GMT). + * + * @param theTime + * number of milliseconds since the Epoch (January 1 1970, + * 00:00:00.000 GMT). + * @since Android 1.0 */ @Override public void setTime(long theTime) { @@ -304,10 +352,11 @@ public class Timestamp extends Date { /** * Returns the timestamp formatted as a String in the JDBC Timestamp Escape - * format, which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn" + * format, which is {@code "yyyy-mm-dd hh:mm:ss.nnnnnnnnn"}. * - * @return A string representing the instant defined by the Timestamp, in - * JDBC Timestamp escape format + * @return A string representing the instant defined by the {@code + * Timestamp}, in JDBC Timestamp escape format. + * @since Android 1.0 */ @SuppressWarnings("deprecation") @Override @@ -371,15 +420,18 @@ public class Timestamp extends Date { } /** - * Creates a Timestamp object with a time value equal to the time specified - * by a supplied String holding the time in JDBC timestamp escape format, - * which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn" + * Creates a {@code Timestamp} object with a time value equal to the time + * specified by a supplied String holding the time in JDBC timestamp escape + * format, which is {@code "yyyy-mm-dd hh:mm:ss.nnnnnnnnn}" * * @param s - * the String containing a time in JDBC timestamp escape format - * @return A timestamp object with time value as defined by the supplied - * String - * @throws IllegalArgumentException if the provided String is null + * the {@code String} containing a time in JDBC timestamp escape + * format. + * @return A {@code Timestamp} object with time value as defined by the + * supplied {@code String}. + * @throws IllegalArgumentException + * if the provided string is {@code null}. + * @since Android 1.0 */ public static Timestamp valueOf(String s) throws IllegalArgumentException { if (s == null) { diff --git a/sql/src/main/java/java/sql/Types.java b/sql/src/main/java/java/sql/Types.java index 5e9aa4c..8ce0421 100644 --- a/sql/src/main/java/java/sql/Types.java +++ b/sql/src/main/java/java/sql/Types.java @@ -19,7 +19,10 @@ package java.sql; /** * A class which defines constants used to identify generic SQL types, also - * called JDBC types. The type constant values are equivalent to those in XOPEN. + * called JDBC types. The type constant values are equivalent to those defined + * by X/OPEN. + * + * @since Android 1.0 */ public class Types { @@ -31,154 +34,214 @@ public class Types { } /** - * The type code that identifies the SQL type ARRAY. + * The type code that identifies the SQL type {@code ARRAY}. + * + * @since Android 1.0 */ public static final int ARRAY = 2003; /** - * The type code that identifies the SQL type BIGINT. + * The type code that identifies the SQL type {@code BIGINT}. + * + * @since Android 1.0 */ public static final int BIGINT = -5; /** - * The type code that identifies the SQL type BINARY. + * The type code that identifies the SQL type {@code BINARY}. + * + * @since Android 1.0 */ public static final int BINARY = -2; /** - * The type code that identifies the SQL type BIT. + * The type code that identifies the SQL type {@code BIT}. + * + * @since Android 1.0 */ public static final int BIT = -7; /** - * The type code that identifies the SQL type BLOB. + * The type code that identifies the SQL type {@code BLOB}. + * + * @since Android 1.0 */ public static final int BLOB = 2004; /** - * The type code that identifies the SQL type BOOLEAN. + * The type code that identifies the SQL type {@code BOOLEAN}. + * + * @since Android 1.0 */ public static final int BOOLEAN = 16; /** - * The type code that identifies the SQL type CHAR. + * The type code that identifies the SQL type {@code CHAR}. + * + * @since Android 1.0 */ public static final int CHAR = 1; /** - * The type code that identifies the SQL type CLOB. + * The type code that identifies the SQL type {@code CLOB}. + * + * @since Android 1.0 */ public static final int CLOB = 2005; /** - * The type code that identifies the SQL type DATALINK. + * The type code that identifies the SQL type {@code DATALINK}. + * + * @since Android 1.0 */ public static final int DATALINK = 70; /** - * The type code that identifies the SQL type DATE. + * The type code that identifies the SQL type {@code DATE}. + * + * @since Android 1.0 */ public static final int DATE = 91; /** - * The type code that identifies the SQL type DECIMAL. + * The type code that identifies the SQL type {@code DECIMAL}. + * + * @since Android 1.0 */ public static final int DECIMAL = 3; /** - * The type code that identifies the SQL type DISTINCT. + * The type code that identifies the SQL type {@code DISTINCT}. + * + * @since Android 1.0 */ public static final int DISTINCT = 2001; /** - * The type code that identifies the SQL type DOUBLE. + * The type code that identifies the SQL type {@code DOUBLE}. + * + * @since Android 1.0 */ public static final int DOUBLE = 8; /** - * The type code that identifies the SQL type FLOAT. + * The type code that identifies the SQL type {@code FLOAT}. + * + * @since Android 1.0 */ public static final int FLOAT = 6; /** - * The type code that identifies the SQL type INTEGER. + * The type code that identifies the SQL type {@code INTEGER}. + * + * @since Android 1.0 */ public static final int INTEGER = 4; /** - * The type code that identifies the SQL type JAVA_OBJECT. + * The type code that identifies the SQL type {@code JAVA_OBJECT}. + * + * @since Android 1.0 */ public static final int JAVA_OBJECT = 2000; /** - * The type code that identifies the SQL type LONGVARBINARY. + * The type code that identifies the SQL type {@code LONGVARBINARY}. + * + * @since Android 1.0 */ public static final int LONGVARBINARY = -4; /** - * The type code that identifies the SQL type LONGVARCHAR. + * The type code that identifies the SQL type {@code LONGVARCHAR}. + * + * @since Android 1.0 */ public static final int LONGVARCHAR = -1; /** - * The type code that identifies the SQL type NULL. + * The type code that identifies the SQL type {@code NULL}. + * + * @since Android 1.0 */ public static final int NULL = 0; /** - * The type code that identifies the SQL type NUMERIC. + * The type code that identifies the SQL type {@code NUMERIC}. + * + * @since Android 1.0 */ public static final int NUMERIC = 2; /** * The type code that identifies that the SQL type is database specific and * is mapped to a Java object, accessed via the methods - * <code>getObject</code> and <code>setObject</code>. + * {@code getObject} and {@code setObject}. + * + * @since Android 1.0 */ public static final int OTHER = 1111; /** - * The type code that identifies the SQL type REAL. + * The type code that identifies the SQL type {@code REAL}. + * + * @since Android 1.0 */ public static final int REAL = 7; /** - * The type code that identifies the SQL type REF. + * The type code that identifies the SQL type {@code REF}. + * + * @since Android 1.0 */ public static final int REF = 2006; /** - * The type code that identifies the SQL type SMALLINT. + * The type code that identifies the SQL type {@code SMALLINT}. + * + * @since Android 1.0 */ public static final int SMALLINT = 5; /** - * The type code that identifies the SQL type STRUCT. + * The type code that identifies the SQL type {@code STRUCT}. + * + * @since Android 1.0 */ public static final int STRUCT = 2002; /** - * The type code that identifies the SQL type TIME. + * The type code that identifies the SQL type {@code TIME}. + * + * @since Android 1.0 */ public static final int TIME = 92; /** - * The type code that identifies the SQL type TIMESTAMP. + * The type code that identifies the SQL type {@code TIMESTAMP}. + * + * @since Android 1.0 */ public static final int TIMESTAMP = 93; /** - * The type code that identifies the SQL type TINYINT. + * The type code that identifies the SQL type {@code TINYINT}. + * + * @since Android 1.0 */ public static final int TINYINT = -6; /** - * The type code that identifies the SQL type VARBINARY. + * The type code that identifies the SQL type {@code VARBINARY}. + * + * @since Android 1.0 */ public static final int VARBINARY = -3; /** - * The type code that identifies the SQL type VARCHAR. + * The type code that identifies the SQL type {@code VARCHAR}. + * + * @since Android 1.0 */ public static final int VARCHAR = 12; } diff --git a/sql/src/main/java/java/sql/package.html b/sql/src/main/java/java/sql/package.html index e46f170..9ae2488 100644 --- a/sql/src/main/java/java/sql/package.html +++ b/sql/src/main/java/java/sql/package.html @@ -2,6 +2,7 @@ <body> <p> Provides a standard interface for accessing SQL-based databases. - <p> + </p> + @since Android 1.0 </body> </html>
\ No newline at end of file diff --git a/sql/src/main/java/javax/sql/ConnectionEvent.java b/sql/src/main/java/javax/sql/ConnectionEvent.java index e8ec7c3..e07e7c1 100644 --- a/sql/src/main/java/javax/sql/ConnectionEvent.java +++ b/sql/src/main/java/javax/sql/ConnectionEvent.java @@ -22,9 +22,11 @@ import java.sql.SQLException; import java.io.Serializable; /** - * An Event object which is sent when specific events happen on a - * PooledConnection object. The events involved are when the application closing - * the PooledConnection and when an error occurs in the PooledConnection. + * Sent when specific events happen on a {@link PooledConnection} object. These + * events are a facility to report when an application closes the pooled + * connection or when an error occurs in the pooled connection. + * + * @since Android 1.0 */ public class ConnectionEvent extends EventObject implements Serializable { @@ -33,25 +35,29 @@ public class ConnectionEvent extends EventObject implements Serializable { private SQLException theSQLException; /** - * Creates a connection event initialized with a supplied PooledConnection. + * Creates a connection event initialized with the supplied {@code + * PooledConnection} reporting that the application has closed the + * connection. * * @param theConnection - * the PooledConnection + * the connection for which this event is created. + * @since Android 1.0 */ public ConnectionEvent(PooledConnection theConnection) { super(theConnection); } /** - * Creates a ConnectionEvent initialized with a supplied PooledConnection - * and with a supplied SQLException indicating that an error has occurred - * within the PooledConnection. + * Creates a {@code ConnectionEvent} initialized with the supplied {@code + * PooledConnection} and with the supplied {@code SQLException} indicating + * that an error has occurred within the {@code PooledConnection}. * * @param theConnection - * the PooledConnection + * the connection for which this event is created. * @param theException - * the SQLException holding information about the error that has - * occurred, which is about to be returned to the application. + * information about the state of error that has occurred on the + * application side. + * @since Android 1.0 */ public ConnectionEvent(PooledConnection theConnection, SQLException theException) { @@ -60,11 +66,12 @@ public class ConnectionEvent extends EventObject implements Serializable { } /** - * Gets the SQLException which holds information about the error which - * occurred in the PooledConnection. + * Gets the {@code SQLException} which holds information about the error + * which occurred in the {@code PooledConnection}. * - * @return an SQLException containing information about the error. May be - * null if no error has occurred. + * @return a {@code SQLException} containing information about the error. + * May be {@code null} if no error has occurred. + * @since Android 1.0 */ public SQLException getSQLException() { return theSQLException; diff --git a/sql/src/main/java/javax/sql/ConnectionEventListener.java b/sql/src/main/java/javax/sql/ConnectionEventListener.java index 7156558..1333814 100644 --- a/sql/src/main/java/javax/sql/ConnectionEventListener.java +++ b/sql/src/main/java/javax/sql/ConnectionEventListener.java @@ -20,40 +20,44 @@ package javax.sql; import java.util.EventListener; /** - * An interface used to receive events generated by a - * <code>PooledConnection</code>. + * An interface used to receive events generated by a {@link PooledConnection}. * <p> - * This interface would typically be implemented by a component which implements - * Connection Pooling (a Connection Pool Manager). A Connection will signal - * events to a ConnectionEventListener either when the application closes a - * Connection it has been using or when a significant error occurs while the - * Connection is being used, where the Connection should not be used again. + * This interface would typically be implemented by a component which manages a + * connection pool (a connection pool manager). A connection triggers an event + * to a {@code ConnectionEventListener} either when the application closes a + * connection it has been using or when a significant error occurs while the + * connection is being used. + * </p> * <p> - * The Connection Pool Manager can return closed Connections to the Pool for + * The connection pool manager can return closed connections to the pool for * later reuse. Connections experiencing an error should be discarded. + * </p> * + * @since Android 1.0 */ public interface ConnectionEventListener extends EventListener { /** - * Notifies the ConnectionEventListener that an application has called the - * <code>close</code> method on a pooled Connection. + * Notifies the {@code ConnectionEventListener} that an application has + * called the {@code close} method on a pooled connection. * * @param theEvent - * a ConnectionEvent containing detail about the source of the - * event. + * a {@code ConnectionEvent} containing details about the source + * of the event. + * @since Android 1.0 */ public void connectionClosed(ConnectionEvent theEvent); /** - * Notifies the ConnectionEventListener that an error has occurred while a - * PooledConnection was being used and that the PooledConnection can no - * longer be used for work. This notification is done just before the - * SQLException passed in the event message is thrown to the application. + * Notifies the {@code ConnectionEventListener} that an error has occurred + * on a {@code PooledConnection}. This notification is triggered <i>before</i> the + * {@code SQLException}, which is available through the event argument, is + * thrown. * * @param theEvent - * a ConnectionEvent containing detail about the source of the - * event and the SQLException that has occurred. + * a {@code ConnectionEvent} containing details about the source + * of the event and the {@code SQLException} that has occurred. + * @since Android 1.0 */ public void connectionErrorOccurred(ConnectionEvent theEvent); } diff --git a/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java b/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java index 5be75d9..d73128b 100644 --- a/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java +++ b/sql/src/main/java/javax/sql/ConnectionPoolDataSource.java @@ -21,103 +21,117 @@ import java.sql.SQLException; import java.io.PrintWriter; /** - * An interface for the creation of PooledConnection objects. Used internally - * within the package. + * An interface for the creation of {@code ConnectionPoolDataSource} objects. + * Used internally within the package. * <p> - * A class which implements the ConnectionPoolDataSource interface is typically - * registered with a JNDI naming service directory and is retrieved from there - * by name. + * A class which implements the {@code ConnectionPoolDataSource} interface is + * typically registered with a JNDI naming service directory and is retrieved + * from there by name. + * </p> + * + * @since Android 1.0 */ public interface ConnectionPoolDataSource { /** - * Gets the Login Timeout value for this ConnectionPoolDataSource. The Login - * Timeout is the maximum time in seconds that the ConnectionPoolDataSource - * will wait when opening a connection to a database. A Timeout value of 0 - * implies either the system default timeout value (if there is one) or that - * there is no timeout. The default value for the Login Timeout is 0. + * Gets the login timeout value for this {@code ConnectionPoolDataSource}. + * The login timeout is the maximum time in seconds that the {@code + * ConnectionPoolDataSource} will wait when opening a connection to a + * database. A timeout value of 0 implies either the system default timeout + * value (if there is one) or that there is no timeout. The default value + * for the login timeout is {@code 0}. * - * @return the Login Timeout value in seconds. + * @return the login timeout value in seconds. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public int getLoginTimeout() throws SQLException; /** - * Gets the Log Writer for this ConnectionPoolDataSource. + * Gets the log writer for this {@code ConnectionPoolDataSource}. * <p> - * The Log Writer is a stream to which all log and trace messages are sent - * from this ConnectionPoolDataSource. The Log Writer can be null, in which - * case, log and trace capture is disabled. The default value for the Log - * Writer when an ConnectionPoolDataSource is created is null. Note that the - * Log Writer for an ConnectionPoolDataSource is not the same as the Log - * Writer used by a <code>DriverManager</code>. + * The log writer is a stream to which all log and trace messages are sent + * from this {@code ConnectionPoolDataSource}. The log writer can be {@code + * null}, in which case the log and trace capture is disabled. The default + * value for the log writer when an {@code ConnectionPoolDataSource} is + * created is {@code null}. Note that the log writer for an {@code + * ConnectionPoolDataSource} is not the same as the log writer used by a + * {@code DriverManager}. + * </p> * - * @return a PrintWriter which is the Log Writer for this - * ConnectionPoolDataSource. Can be null, in which case log writing - * is disabled for this ConnectionPoolDataSource. + * @return a {@code PrintWriter} which is the log writer for this {@code + * ConnectionPoolDataSource}. Can be {@code null}, in which case log + * writing is disabled for this {@code ConnectionPoolDataSource}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public PrintWriter getLogWriter() throws SQLException; /** - * Create a connection to a database which can then be used as a pooled + * Creates a connection to a database which can then be used as a pooled * connection. * - * @return a PooledConnection which represents the connection to the - * database + * @return a {@code PooledConnection} which represents the connection to the + * database. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public PooledConnection getPooledConnection() throws SQLException; /** - * Create a connection to a database, using a supplied Username and - * Password, which can then be used as a pooled connection. + * Creates a connection to a database, using the supplied user name and + * password, which can then be used as a pooled connection. * * @param theUser - * a String containing a User Name for the database + * the a user name for the database login. * @param thePassword - * a String containing the Password for the user identified by - * <code>theUser</code> - * @return a PooledConnection which represents the connection to the - * database + * the password associated with the user identified by {@code + * theUser}. + * @return a {@code PooledConnection} object which represents the connection + * to the database. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public PooledConnection getPooledConnection(String theUser, String thePassword) throws SQLException; /** - * Sets the Login Timeout value for this ConnectionPoolDataSource. The Login - * Timeout is the maximum time in seconds that the ConnectionPoolDataSource - * will wait when opening a connection to a database. A Timeout value of 0 - * implies either the system default timeout value (if there is one) or that - * there is no timeout. The default value for the Login Timeout is 0. + * Sets the login timeout value for this {@code ConnectionPoolDataSource}. + * The login timeout is the maximum time in seconds that the {@code + * ConnectionPoolDataSource} will wait when opening a connection to a + * database. A timeout value of 0 implies either the system default timeout + * value (if there is one) or that there is no timeout. The default value + * for the login timeout is 0. * * @param theTimeout - * the new Login Timeout value in seconds. + * the new login timeout value in seconds. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void setLoginTimeout(int theTimeout) throws SQLException; /** - * Sets the Log Writer for this ConnectionPoolDataSource. + * Sets the log writer for this {@code ConnectionPoolDataSource}. * <p> - * The Log Writer is a stream to which all log and trace messages are sent - * from this ConnectionPoolDataSource. The Log Writer can be null, in which - * case, log and trace capture is disabled. The default value for the Log - * Writer when an ConnectionPoolDataSource is created is null. Note that the - * Log Writer for an ConnectionPoolDataSource is not the same as the Log - * Writer used by a <code>DriverManager</code>. + * The log writer is a stream to which all log and trace messages are sent + * from this {@code ConnectionPoolDataSource}. The log writer can be {@code + * null}, in which case log and trace capture is disabled. The default value + * for the log writer, when a {@code ConnectionPoolDataSource} is created, + * is {@code null}. Note that the log writer for a {@code + * ConnectionPoolDataSource} is not the same as the log writer used by a + * {@code DriverManager}. + * </p> * * @param theWriter - * a PrintWriter to use as the Log Writer for this - * ConnectionPoolDataSource. + * is the log writer for this {@code ConnectionPoolDataSource}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void setLogWriter(PrintWriter theWriter) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/DataSource.java b/sql/src/main/java/javax/sql/DataSource.java index cd3e0a3..98be761 100644 --- a/sql/src/main/java/javax/sql/DataSource.java +++ b/sql/src/main/java/javax/sql/DataSource.java @@ -22,117 +22,137 @@ import java.sql.Connection; import java.io.PrintWriter; /** - * An interface for the creation of Connection objects which represent a - * connection to a database. This interface is an alternative to the - * <code>java.sql.DriverManager</code>. + * An interface for the creation of {@code Connection} objects which represent a + * connection to a database. This interface is an alternative to the {@code + * java.sql.DriverManager}. * <p> - * A class which implements the DataSource interface is typically registered - * with a JNDI naming service directory and is retrieved from there by name. + * A class which implements the {@code DataSource} interface is typically + * registered with a JNDI naming service directory and is retrieved from there + * by name. + * </p> * <p> - * The DataSource interface is typically implemented by the writer of a JDBC - * driver. There are three variants of the DataSource interface, which produce - * Connections with differing characteristics: + * The {@code DataSource} interface is typically implemented by the writer of a + * JDBC driver. There are three variants of the {@code DataSource} interface, + * which produce connections with different characteristics: + * </p> * <ol> - * <li>Standard DataSource, which produces standard Connection objects with no - * special features.</li> - * <li>Connection Pool DataSource, which produces PooledConnection objects - * which are able to participate in connection pooling, typically involving a - * connection pooling manager as an intermediary between applications and the - * database.</li> - * <li>Distributed transaction DataSource ("XADataSource"), which produces - * XAConnection objects which can be used to handle distributed transactions and - * which typically involve a transaction manager component in the system. - * XAConnection objects also typically provide connection pooling capabilities - * as well as distributed transaction capabilities. </li> + * <li><i>Standard {@code DataSource}</i>: produces standard {@code Connection} + * objects with no special features.</li> + * <li><i>Connection Pool {@code DataSource}</i>: produces {@code + * PooledConnection} objects which require a connection pool manager as an + * intermediary component.</li> + * <li><i>Distributed transaction {@code DataSource} ("XADataSource")</i>: + * produces {@code XAConnection} objects which can be used to handle distributed + * transactions which typically require an intermediary transaction manager + * component. {@code XAConnection} objects also provide connection pooling + * capabilities as well as distributed transaction capabilities.</li> * </ol> * <p> - * Note that a JDBC driver which is accessed via the DataSource interface is - * loaded via a JNDI lookup process. A driver loaded in this way does not - * register itself with the <code>DriverManager</code>. + * Note that a JDBC driver which is accessed via the {@code DataSource} + * interface is loaded via a JNDI lookup process. A driver loaded in this way + * does not register itself with the {@code DriverManager}. + * </p> + * + * @since Android 1.0 */ public interface DataSource { /** - * Creates a connection to the database represented by this DataSource. + * Creates a connection to the database represented by this {@code + * DataSource}. * - * @return a Connection object which is a connection to the database. + * @return a {@code Connection} object which is a connection to the + * database. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public Connection getConnection() throws SQLException; /** - * Creates a connection to the database represented by this DataSource, - * using a supplied Username and Password,. + * Creates a connection to the database represented by this {@code + * DataSource}, using the supplied user name and password. * * @param theUsername - * a String containing a User Name for the database + * the a user name for the database login. * @param thePassword - * a String containing the Password for the user identified by - * <code>theUsername</code> - * @return a Connection object which is a connection to the database. + * the password associated with the user identified by {@code + * theUsername}. + * @return the {@code Connection} object which is the connection to the + * database. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public Connection getConnection(String theUsername, String thePassword) throws SQLException; /** - * Gets the Login Timeout value for this DataSource. The Login Timeout is - * the maximum time in seconds that the DataSource will wait when opening a - * connection to a database. A Timeout value of 0 implies either the system - * default timeout value (if there is one) or that there is no timeout. The - * default value for the Login Timeout is 0. + * Gets the login timeout value for this {@code DataSource}. The login + * timeout is the maximum time in seconds that the {@code DataSource} will + * wait when opening a connection to a database. A timeout value of 0 + * implies either the system default timeout value (if there is one) or that + * there is no timeout. The default value for the login timeout is 0. * - * @return the Login Timeout value in seconds. + * @return the login timeout value in seconds. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public int getLoginTimeout() throws SQLException; /** - * Gets the Log Writer for this DataSource. + * Gets the log writer for this {@code DataSource}. * <p> - * The Log Writer is a stream to which all log and trace messages are sent - * from this DataSource. The Log Writer can be null, in which case, log and - * trace capture is disabled. The default value for the Log Writer when an - * DataSource is created is null. Note that the Log Writer for an DataSource - * is not the same as the Log Writer used by a <code>DriverManager</code>. + * The log writer is a stream to which all log and trace messages are sent + * from this {@code DataSource}. The log writer can be {@code null}, in + * which case, log and trace capture is disabled. The default value for the + * log writer when an {@code DataSource} is created is {@code null}. Note + * that the log writer for a {@code DataSource} is not the same as the log + * writer used by a {@code DriverManager}. + * </p> * - * @return a PrintWriter which is the Log Writer for this DataSource. Can be - * null, in which case log writing is disabled for this DataSource. + * @return a {@code PrintWriter} which is the log writer for this {@code + * DataSource}. Can be {@code null}, in which case log writing is + * disabled for this {@code DataSource}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public PrintWriter getLogWriter() throws SQLException; /** - * Sets the Login Timeout value for this DataSource. The Login Timeout is - * the maximum time in seconds that the DataSource will wait when opening a - * connection to a database. A Timeout value of 0 implies either the system - * default timeout value (if there is one) or that there is no timeout. The - * default value for the Login Timeout is 0. + * Sets the login timeout value for this {@code DataSource}. The login + * timeout is the maximum time in seconds that the {@code DataSource} will + * wait when opening a connection to a database. A timeout value of 0 + * implies either the system default timeout value (if there is one) or that + * there is no timeout. The default value for the login timeout is 0. * * @param theTimeout - * the new Login Timeout value in seconds. + * the new login timeout value in seconds. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void setLoginTimeout(int theTimeout) throws SQLException; /** - * Sets the Log Writer for this DataSource. + * Sets the log writer for this {@code DataSource}. * <p> - * The Log Writer is a stream to which all log and trace messages are sent - * from this DataSource. The Log Writer can be null, in which case, log and - * trace capture is disabled. The default value for the Log Writer when an - * DataSource is created is null. Note that the Log Writer for an DataSource - * is not the same as the Log Writer used by a <code>DriverManager</code>. + * The log writer is a stream to which all log and trace messages are sent + * from this {@code DataSource}. The log writer can be {@code null}, in + * which case, log and trace capture is disabled. The default value for the + * log writer when a {@code DataSource} is created is {@code null}. Note + * that the log writer for a {@code DataSource} is not the same as the log + * writer used by a {@code DriverManager}. + * </p> * * @param theWriter - * a PrintWriter to use as the Log Writer for this DataSource. + * a {@code PrintWriter} to use as the log writer for this + * {@code DataSource}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void setLogWriter(PrintWriter theWriter) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/PooledConnection.java b/sql/src/main/java/javax/sql/PooledConnection.java index 50f7ae9..b4c5616 100644 --- a/sql/src/main/java/javax/sql/PooledConnection.java +++ b/sql/src/main/java/javax/sql/PooledConnection.java @@ -24,87 +24,99 @@ import java.sql.Connection; * An interface which provides facilities for handling connections to a database * which are pooled. * <p> - * Typically, a PooledConnection is recycled when it is no longer required by an - * application, rather than being closed and discarded. The reason for treating - * connections in this way is that it can be an expensive process both to - * establish a connection to a database and to destroy the connection. Reusing - * connections through a pool is a way of improving system performance and - * reducing overhead. + * Typically, a {@code PooledConnection} is recycled when it is no longer + * required by an application, rather than being closed and discarded. The + * reason for treating connections in this way is that it can be an expensive + * process both to establish a connection to a database and to destroy the + * connection. Reusing connections through a pool is a way of improving system + * performance and reducing overhead. + * </p> * <p> - * It is not intended that an application use the PooledConnection interface - * directly. The PooledConnection interface is intended for use by a component - * called a Connection Pool Manager, typically part of the infrastructure that - * supports use of the database by applications. + * It is not intended that an application uses the {@code PooledConnection} + * interface directly. The {@code PooledConnection} interface is intended for + * use by a component called a connection pool manager, typically part of the + * infrastructure that supports use of the database by applications. + * </p> * <p> * Applications obtain connections to the database by calling the - * <code>DataSource.getConnection</code> method. Under the covers, the - * Connection Pool Manager will get a PooledConnection object from its - * connection pool and passes back a Connection object that wraps or references - * the PooledConnection object. A new PooledConnection object will only be + * {@link DataSource#getConnection} method. Behind the scenes, the connection + * pool manager will get a {@code PooledConnection} object from its connection + * pool and passes back a connection object that wraps or references the {@code + * PooledConnection} object. A new {@code PooledConnection} object will only be * created if the pool is empty. + * </p> * <p> - * When the application is finished using a PooledConnection, the application - * calls the <code>Connection.close</code> method. The Connection Pool Manager - * is notified via a ConnectionEvent from the Connection that this has happened - * (the Pool Manager registers itself with the Connection before the Connection - * is given to the application). The Pool Manager removes the underlying - * PooledConnection object from the Connection and returns it to the pool for - * reuse - the PooledConnection is thus recycled rather than being destroyed. + * When the application is finished using a {@code PooledConnection}, the + * application calls the {@link Connection#close} method. The connection pool + * manager is notified via a {@link ConnectionEvent} from the connection that + * this has happened (the pool manager registers itself with the connection + * before the connection is given to the application). The pool manager removes + * the underlying {@code PooledConnection} object from the connection and + * returns it to the pool for reuse - the {@code PooledConnection} is thus + * recycled rather than being destroyed. + * </p> * <p> - * The connection to the database represented by the PooledConnection is kept - * open until the PooledConnection object itself is deactivated by the - * Connection Pool Manager, which calls the <code>PooledConnection.close</code> - * method. This is typically done if there are too many inactive connections in - * the pool, if the PooledConnection encounters a problem that makes it unusable - * or if the whole system is being shut down. + * The connection to the database represented by the {@code PooledConnection} is + * kept open until the {@code PooledConnection} object itself is deactivated by + * the connection pool manager, which calls {@code PooledConnection.close()}. + * This is typically done if there are too many inactive connections in the + * pool, if the {@code PooledConnection} encounters a problem that makes it + * unusable or if the whole system is being shut down. + * </p> * + * @since Android 1.0 */ public interface PooledConnection { /** - * Registers the supplied ConnectionEventListener with this - * PooledConnection. Once registered, the ConnectionEventListener will - * receive ConnectionEvent events when they occur in the PooledConnection. + * Registers the supplied {@code ConnectionEventListener} with this {@code + * PooledConnection}. Once registered, the {@code ConnectionEventListener} + * will receive {@link ConnectionEvent} events when they occur in the + * {@code PooledConnection}. * * @param theListener - * an object which implements the ConnectionEventListener + * an object which implements the {@code ConnectionEventListener} * interface. + * @since Android 1.0 */ public void addConnectionEventListener(ConnectionEventListener theListener); /** - * Closes the connection to the database held by this PooledConnection. This - * method should not be called directly by application code - it is intended - * for use by the Connection Pool manager component. + * Closes the connection to the database held by this {@code + * PooledConnection}. This method should not be called directly by + * application code - it is intended only for the connection pool manager + * component. * * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void close() throws SQLException; /** * Creates a connection to the database. This method is typically called by - * the Connection Pool manager when an application invokes the method - * <code>DataSource.getConnection</code> and there are no PooledConnection - * objects available in the connection pool. + * the connection pool manager when an application invokes the method + * {@code DataSource.getConnection()} and there are no {@code + * PooledConnection} objects available in the connection pool. * - * @return a Connection object that is a handle to this PooledConnection - * object. + * @return a {@code Connection} object. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public Connection getConnection() throws SQLException; /** - * Deregister the supplied ConnectionEventListener from this - * PooledConnection. Once deregistered, the ConnectionEventListener will not - * longer receive events occurring in the PooledConnection. + * Unregisters the supplied {@code ConnectionEventListener} from this {@code + * PooledConnection}. Once unregistered, the {@code ConnectionEventListener} + * will no longer receive events occurring in the {@code PooledConnection}. * * @param theListener - * an object which implements the ConnectionEventListener + * an object which implements the {@code ConnectionEventListener} * interface. This object should have previously been registered - * with the PooledConnection using the - * <code>addConnectionEventListener</code> method. + * with the {@code PooledConnection} using the {@code + * addConnectionEventListener} method. + * @since Android 1.0 */ public void removeConnectionEventListener( ConnectionEventListener theListener); diff --git a/sql/src/main/java/javax/sql/RowSet.java b/sql/src/main/java/javax/sql/RowSet.java index 2794ff2..4edc3d3 100644 --- a/sql/src/main/java/javax/sql/RowSet.java +++ b/sql/src/main/java/javax/sql/RowSet.java @@ -33,824 +33,953 @@ import java.util.Calendar; import java.math.BigDecimal; /** - * A RowSet is an interface which provides access to data being sent from/to a - * database and which extends the functionality of ResultSet into a form that - * can be used as a JavaBeans component, perhaps being used in a visual - * programming environment. + * An interface which provides means to access data which + * persists on a database. It extends the functionality of + * {@link java.sql.ResultSet ResultSet} into a form that it can be used as a + * JavaBean component, suited for a visual programming environment. * <p> - * Facilities are provided for get/set of properties relating to the Database - * and the SQL Command and for getting/setting data within the Rows represented - * by the RowSet. The RowSet supports JavaBeans events so that other components - * in an application can be informed when various changes happen to the RowSet, - * such as changes in data values. + * {@code RowSet} provides getters and setters for properties relating to the + * general database environment together with the getters and setters for + * distinct data values which constitute the row set. The {@code RowSet} class + * supports JavaBean events so that other components in an application can be + * informed when changes happen such as changes in data values. + * </p> * <p> - * RowSet is implemented as a layer on top of the remainder of the JDBC API. A - * RowSet may be <i>connected</i> where it maintains a connection to the - * database throughout its lifecycle. A RowSet may be <i>disconnected</i> where - * it establishes a connection to the database, gets data and then closes the - * connection. Updates to a disconnected RowSet can be made and later send back - * the changes to the database, but this requires the RowSet to first reconnect - * to the database before the changes are sent back. + * {@code RowSet} is a facility implemented on top of the remainder of the JDBC + * API. It may be <i>connected</i>, maintaining a connection to the database + * throughout its lifecycle. The changes made on a <i>disconnected</i> {@code + * RowSet} on the other hand can be persisted only establishing a new connection + * with the database each time. + * </p> * <p> - * Disconnected RowSets may make use of RowSetReaders to populate the RowSet - * with data, possibly from a non-relational database source. Disconnected - * RowSets may also use RowSetWriters to send data back to the underlying data - * store. There is considerable freedom in the way that RowSetReaders and - * RowSetWriters are implemented to get and store data. + * Disconnected {@code RowSets} make use of {@code RowSetReaders} to populate + * the {@code RowSet} with data, possibly from a non-relational database source. + * They may also use {@code RowSetWriters} to send data back to the underlying + * data store. There is considerable freedom in the way that {@code + * RowSetReaders} and {@code RowSetWriters} may be implemented to retrieve and + * store data. + * </p> + * + * @see RowSetReader + * @see RowSetWriter + * @since Android 1.0 */ public interface RowSet extends ResultSet { /** - * Registers a supplied RowSetListener with this RowSet. Once registered, - * the RowSetListener is notified of events generated by the RowSet. + * Registers the supplied {@link RowSetListener} with this {@code RowSet}. + * Once registered, the {@link RowSetListener} is notified of events + * generated by the {@code RowSet}. * * @param theListener - * an object which implements the <code>rowSetListener</code> + * an object which implements the {@code rowSetListener} * interface. + * @since Android 1.0 */ public void addRowSetListener(RowSetListener theListener); /** - * Clears the parameters previously set for this RowSet. + * Clears the parameters previously set for this {@code RowSet}. * <p> - * Parameter values apply to repeated use of a RowSet object. Setting a new - * value for a parameter clears its previous value. - * <code>clearParameters</code> clears the values for all parameters with - * one method call. + * The {@code RowSet} object retains its value until either a new value for + * a parameter is set or its value is actively reset. {@code + * clearParameters} provides a facility to clear the values for all + * parameters with one method call. + * </p> * * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void clearParameters() throws SQLException; /** - * Fetches data for this RowSet. If successful, any existing data for the - * RowSet is discarded and the metadata for the rowset is set. + * Fetches data for this {@code RowSet} from the database. If successful, + * any existing data for the {@code RowSet} is discarded and its metadata is + * overwritten. * <p> - * Data is retrieved connects to the database and executes a Command. This - * requires some or all of the following properties to be set: url, data - * source name, user name, password, transaction isolation, type map ; plus - * some or all of the properties: command, read only, maximum field size, - * maximum rows, escape processing, and query timeout. + * Data is retrieved connecting to the database and executing an + * according SQL statement. This requires some or all of the following + * properties to be set: URL, database name, user name, password, + * transaction isolation, type map; plus some or all of the properties: + * command, read only, maximum field size, maximum rows, escape processing, + * and query timeout. + * </p> * <p> - * The RowSet may use a RowSetReader to access the database - in this case a - * reader must be registered with the RowSet and the RowSet will then invoke - * the <code>readData</code> method on the reader to fetch the data. + * The {@code RowSet} may use a {@code RowSetReader} to access the database + * it will then invoke the {@link RowSetReader#readData} method on the + * reader to fetch the data. When the new data is fetched all the listeners + * are notified to take appropriate measures. + * </p> * * @throws SQLException * if a problem occurs accessing the database or if the - * properties needed to access the database have not been set + * properties needed to access the database have not been set. + * @see RowSetMetaData + * @see RowSetReader + * @since Android 1.0 */ public void execute() throws SQLException; /** - * Gets the RowSet's Command property. + * Gets the {@code RowSet}'s command property. * - * @return a string containing the RowSet's Command property - this is an - * SQL Query which can be executed to fetch data into the RowSet. + * @return a string containing the {@code RowSet}'s command property. A + * command is a SQL statement which is executed to fetch required + * data into the {@code RowSet}. + * @since Android 1.0 */ public String getCommand(); /** - * Gets the name of the datasource for this RowSet. + * Gets the ODBC Data Source Name property associated with this {@code + * RowSet}. The database name can be used to find a {@link DataSource} + * which has been registered with a naming service - the {@link DataSource} + * can then be used to create a connection to the database. * - * @return a String containing the name of the datasource. + * @return the name of the database. + * @since Android 1.0 */ public String getDataSourceName(); /** - * Reports if escape processing is enabled for this RowSet. - * <p> - * If <code>true</code> (the default) the driver will automatically - * perform escape code processing on SQL statements prior to them being sent - * to the database. + * Reports if escape processing is enabled for this {@code RowSet}. If + * escape processing is on, the driver performs a substitution of the escape + * syntax with the applicable code before sending an SQL command to the + * database. The default value for escape processing is {@code true}. * - * @return true if escape processing is enabled, false otherwise. + * @return {@code true} if escape processing is enabled, {@code + * false} otherwise. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public boolean getEscapeProcessing() throws SQLException; /** * Gets the maximum number of bytes that can be returned for column values - * which are of types BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR, - * or LONGVARCHAR. Excess data is silently discarded if the number is + * which are of type {@code BINARY}, {@code VARBINARY}, {@code + * LONGVARBINARYBINARY}, {@code CHAR}, {@code VARCHAR}, or {@code + * LONGVARCHAR}. Excess data is silently discarded if the number is * exceeded. * - * @return the current maximum size in bytes. 0 means no limit + * @return the current maximum size in bytes. 0 implies no size limit. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public int getMaxFieldSize() throws SQLException; /** - * Gets the maximum number of rows for this RowSet. Excess rows are + * Gets the maximum number of rows for this {@code RowSet}. Excess rows are * discarded silently if the limit is exceeded. * - * @return the previous maximum number of rows. 0 implies no limit. + * @return the previous maximum number of rows. 0 implies no row limit. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public int getMaxRows() throws SQLException; /** - * Gets the value of the password property for this RowSet. This property - * is used when making a connection to the database and should be set before - * invoking the <code>execute</code> method. + * Gets the value of the password property for this {@code RowSet}. This + * property is used when a connection to the database is established. + * Therefore it should be set prior to invoking the {@link #execute} method. * - * @return a String containing the value of the password property. + * @return the value of the password property. + * @since Android 1.0 */ public String getPassword(); /** - * Gets the Timeout for the driver when executing a Query operation. - * <p> - * If a Query takes longer than the Timeout, an exception is thrown. + * Gets the timeout for the driver when a query operation is executed. If a + * query takes longer than the timeout then a {@code SQLException} is + * thrown. * - * @return the Timeout value in seconds. + * @return the timeout value in seconds. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public int getQueryTimeout() throws SQLException; /** - * Gets the transaction isolation property setting for this RowSet. + * Gets the transaction isolation level property set for this + * {@code RowSet}. The transaction isolation level defines the + * policy implemented on the database for maintaining the data + * values consistent. * - * @return an integer holding the current transaction isolation setting. One - * of: one of Connection.TRANSACTION_READ_UNCOMMITTED, - * Connection.TRANSACTION_READ_COMMITTED, - * Connection.TRANSACTION_REPEATABLE_READ, - * Connection.TRANSACTION_SERIALIZABLE + * @return the current transaction isolation level. Must be one of: + * <ul> + * <li>{@code Connection.TRANSACTION_READ_UNCOMMITTED}</li> + * <li>{@code Connection.TRANSACTION_READ_COMMITTED}</li> + * <li>{@code Connection.TRANSACTION_REPEATABLE_READ}</li> + * <li>{@code Connection.TRANSACTION_SERIALIZABLE}</li> + * </ul> + * @see java.sql.Connection + * @since Android 1.0 */ public int getTransactionIsolation(); /** - * Gets the custom mapping of SQL types for this RowSet, if any. + * Gets the custom mapping of SQL User-Defined Types (UDTs) and Java classes + * for this {@code RowSet}, if applicable. * - * @return a Map holding the custom mappings of SQL types to Java classes for - * this RowSet. By default, the Map is empty. + * @return the custom mappings of SQL types to Java classes. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public Map<String, Class<?>> getTypeMap() throws SQLException; /** - * Gets the URL property value for this RowSet. If there is no DataSource - * object specified, the RowSet uses the URL to establish a connection to - * the database. The default value for the URL is null. + * Gets the URL property value for this {@code RowSet}. If there is no + * {@code DataSource} object specified, the {@code RowSet} uses the URL to + * establish a connection to the database. The default value for the URL is + * {@code null}. * * @return a String holding the value of the URL property. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public String getUrl() throws SQLException; /** - * Gets the value of the Username property for this RowSet. The Username is - * used when establishing a connection to the database and should be set - * before the <code>execute</code> method is invoked. + * Gets the value of the {@code username} property for this {@code RowSet}. + * The {@code username} is used when establishing a connection to the + * database and should be set before the {@code execute} method is invoked. * - * @return a String holing the value of the Username property. + * @return a {@code String} holding the value of the {@code username} + * property. + * @since Android 1.0 */ public String getUsername(); /** - * Reports if this RowSet is read only. + * Indicates if this {@code RowSet} is read-only. * - * @return true if this RowSet is read only, false if it is updateable. + * @return {@code true} if this {@code RowSet} is read-only, {@code false} + * if it is updatable. + * @since Android 1.0 */ public boolean isReadOnly(); /** - * Removes a specified RowSetListener object from the set of listeners which - * will be notified of events by this RowSet. + * Removes a specified {@link RowSetListener} object from the set of + * listeners which will be notified of events by this {@code RowSet}. * * @param theListener - * the RowSetListener to remove from the set of listeners for - * this RowSet. + * the {@link RowSetListener} to remove from the set of listeners + * for this {@code RowSet}. + * @since Android 1.0 */ public void removeRowSetListener(RowSetListener theListener); /** - * Sets the specified ARRAY parameter in the RowSet command with the - * supplied java.sql.Array value. + * Sets the specified {@code ARRAY} parameter in the {@code RowSet} command + * with the supplied {@code java.sql.Array} value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theArray - * the java.sql.Array value to set + * the {@code Array} data value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setArray(int parameterIndex, Array theArray) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * ASCII data in the supplied java.io.InputStream value. Data is read from - * the InputStream until end-of-file is reached. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the ASCII data in the supplied {@code java.io.InputStream} value. + * Data is read from the {@code InputStream} until end-of-file is reached. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theInputStream - * an InputStream containing the ASCII data to set into the - * parameter value + * the ASCII data value to which the parameter is set. * @param length - * the length of the data in bytes + * the length of the data in bytes. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setAsciiStream(int parameterIndex, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of the specified SQL NUMERIC parameter in the RowSet - * command with the data in the supplied java.math.BigDecimal value. + * Sets the value of the specified SQL {@code NUMERIC} parameter in the + * {@code RowSet} command with the data in the supplied {@code + * java.math.BigDecimal} value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theBigDecimal - * the BigDecimal containing the value + * the big decimal value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setBigDecimal(int parameterIndex, BigDecimal theBigDecimal) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * binary data in the supplied java.io.InputStream value. Data is read from - * the InputStream until end-of-file is reached. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the binary data in the supplied input stream. Data is read from the + * input stream until end-of-file is reached. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theInputStream - * an InputStream containing the binary data to set into the - * parameter value + * the binary data stream to which the parameter is set. * @param length - * the length of the data in bytes + * the length of the data in bytes. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setBinaryStream(int parameterIndex, InputStream theInputStream, int length) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * value of a supplied java.sql.Blob. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the supplied {@code Blob} value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theBlob - * the Blob value to set + * the {@code Blob} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setBlob(int parameterIndex, Blob theBlob) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to the - * supplied boolean. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the supplied boolean. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theBoolean - * the boolean value to set + * the {@code boolean} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setBoolean(int parameterIndex, boolean theBoolean) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to the - * supplied byte value. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the supplied byte value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theByte - * the byte value to set + * the {@code byte} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setByte(int parameterIndex, byte theByte) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to the - * supplied byte array value. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the supplied byte array value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theByteArray - * the array of bytes to set into the parameter. + * the {@code Array} of {@code bytes} to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setBytes(int parameterIndex, byte[] theByteArray) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to the - * sequence of Unicode characters carried by the supplied java.io.Reader. + * Sets the value of the specified parameter in the {@code RowSet} command + * to the sequence of Unicode characters carried by the supplied {@code + * java.io.Reader}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theReader - * the Reader which contains the Unicode data to set into the - * parameter + * the {@code Reader} which contains the Unicode data to set the + * parameter. * @param length - * the length of the data in the Reader in characters + * the length of the data in the {@code Reader} in characters. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setCharacterStream(int parameterIndex, Reader theReader, int length) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * value of a supplied java.sql.Clob. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the value of a supplied {@code java.sql.Clob}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theClob - * the Clob value to set + * the {@code Clob} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setClob(int parameterIndex, Clob theClob) throws SQLException; /** - * Sets the Command property for this RowSet - the command is an SQL Query - * which runs when the <code>execute</code> method is invoked. This - * property is optional for datasources that do not support commands. + * Sets the Command property for this {@code RowSet} - the command is an SQL + * query which runs when the {@code execute} method is invoked. This + * property is optional for databases that do not support commands. * * @param cmd - * a String containing the SQL Query. Can be null. + * the SQL query. Can be {@code null}. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setCommand(String cmd) throws SQLException; /** - * Sets the concurrency property of this RowSet. The default value is - * ResultSet.CONCUR_READ_ONLY. + * Sets the concurrency property of this {@code RowSet}. The default value + * is {@code ResultSet.CONCUR_READ_ONLY}. * * @param concurrency - * the new concurrency value - one of: ResultSet.CONCUR_READ_ONLY - * or ResultSet.CONCUR_UPDATABLE + * the concurrency value. One of: + * <ul> + * <li>{@code ResultSet.CONCUR_READ_ONLY}</li> + * <li>{@code ResultSet.CONCUR_UPDATABLE}</li> + * </ul> * @throws SQLException * if an error occurs accessing the database. + * @see java.sql.ResultSet + * @since Android 1.0 */ public void setConcurrency(int concurrency) throws SQLException; /** - * Sets the Data Source Name property for the RowSet. + * Sets the database name property for the {@code RowSet}. * <p> - * The Data Source Name can be used to find a <code>DataSource</code> - * which has been registered with a naming service - the DataSource can then - * be used to create a connection to the database. + * The database name can be used to find a {@link DataSource} which has been + * registered with a naming service - the {@link DataSource} can then be + * used to create a connection to the database. + * </p> * * @param name - * a String with the new Data Source Name. + * the database name. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setDataSourceName(String name) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * value of a supplied java.sql.Date. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the value of a supplied {@code java.sql.Date}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theDate - * the Date to use + * the date value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setDate(int parameterIndex, Date theDate) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * value of a supplied java.sql.Date, where the conversion of the Date to an - * SQL DATE value is calculated using a supplied Calendar. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the value of a supplied {@code java.sql.Date}, where the conversion + * of the date to an SQL {@code DATE} value is calculated using a supplied + * {@code Calendar}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theDate - * the Date to use + * the date to which the parameter is set. * @param theCalendar - * the Calendar to use in converting the Date to an SQL DATE value + * the {@code Calendar} to use in converting the Date to an SQL + * {@code DATE} value. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setDate(int parameterIndex, Date theDate, Calendar theCalendar) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * supplied double. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the supplied {@code double}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theDouble - * the double value to set + * the {@code double} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setDouble(int parameterIndex, double theDouble) throws SQLException; /** - * Sets the Escape Processing status for this RowSet. If escape processing - * is on, the driver performs escape substitution before sending an SQL - * command to the database. The default value for escape processing is on. + * Sets the escape processing status for this {@code RowSet}. If escape + * processing is on, the driver performs a substitution of the escape syntax + * with the applicable code before sending an SQL command to the database. + * The default value for escape processing is {@code true}. * * @param enable - * true to enable Escape Processing, false to turn it off. + * {@code true} to enable escape processing, {@code false} to + * turn it off. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setEscapeProcessing(boolean enable) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * supplied float. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the supplied {@code float}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theFloat - * the float value to set + * the {@code float} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setFloat(int parameterIndex, float theFloat) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * supplied integer. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the supplied {@code integer}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theInteger - * the integer value to set + * the {@code integer} value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setInt(int parameterIndex, int theInteger) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command with the - * supplied long. + * Sets the value of the specified parameter in the {@code RowSet} command + * with the supplied {@code long}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theLong - * the long value to set + * the {@code long} value value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setLong(int parameterIndex, long theLong) throws SQLException; /** * Sets the maximum number of bytes which can be returned for a column value - * where the column type BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, - * VARCHAR, or LONGVARCHAR. Data which exceeds this limit is silently - * discarded. For portability, a value greater than 256 is recommended. + * where the column type is one of {@code BINARY}, {@code VARBINARY}, + * {@code LONGVARBINARYBINARY}, {@code CHAR}, {@code VARCHAR}, or {@code + * LONGVARCHAR}. Data which exceeds this limit is silently discarded. For + * portability, a value greater than 256 is recommended. * * @param max * the maximum size of the returned column value in bytes. 0 - * means unlimited. + * implies no size limit. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setMaxFieldSize(int max) throws SQLException; /** - * Sets the maximum number of rows which can be held by the RowSet. Any - * additional rows are silently discarded. + * Sets the maximum number of rows which can be held by the {@code RowSet}. + * Any additional rows are silently discarded. * * @param max - * the maximum number of rows which can be held in the RowSet. 0 - * means no limit. + * the maximum number of rows which can be held in the {@code + * RowSet}. 0 means no limit. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setMaxRows(int max) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to SQL - * NULL. + * Sets the value of the specified parameter in the {@code RowSet} command + * to SQL {@code NULL}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param sqlType - * the type of the parameter, as defined by java.sql.Types. + * the type of the parameter, as defined by {@code + * java.sql.Types}. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setNull(int parameterIndex, int sqlType) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to SQL - * NULL. This form of the <code>setNull</code> method should be used for - * User Defined Types and REF parameters. + * Sets the value of the specified parameter in the {@code RowSet} command + * to SQL {@code NULL}. This form of the {@code setNull} method should be + * used for User Defined Types and {@code REF} parameters. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param sqlType - * the type of the parameter, as defined by java.sql.Types. + * the type of the parameter, as defined by {@code + * java.sql.Types}. * @param typeName - * the fully qualified name of an SQL User Defined Type or the - * name of the SQL structured type referenced by a REF type. - * Ignored if the sqlType is not a UDT or REF type. + * the fully qualified name of an SQL user defined type or the + * name of the SQL structured type referenced by a {@code REF} + * type. Ignored if the sqlType is not a UDT or REF type. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied Java object. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied Java object. * <p> * The JDBC specification provides a standard mapping for Java objects to * SQL data types. Database specific types can be mapped by JDBC driver * specific Java types. + * </p> * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theObject - * the Java object containing the data value. + * the Java object containing the data value to which the + * parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied Java object. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied Java object. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theObject * the Java object containing the data value. * @param targetSqlType - * the SQL type to send to the database, as defined in - * java.sql.Types. + * the SQL type to send to the database, as defined in {@code + * java.sql.Types}. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject, int targetSqlType) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied Java object. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied Java object. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theObject * the Java object containing the data value. * @param targetSqlType - * the SQL type to send to the database, as defined in - * java.sql.Types. + * the SQL type to send to the database, as defined in {@code + * java.sql.Types}. * @param scale - * the number of digits after the decimal point, for - * java.sql.Types.DECIMAL and java.sql.Types.NUMERIC types. - * Ignored for all other types. + * the number of digits after the decimal point, for {@code + * java.sql.Types.DECIMAL} and {@code java.sql.Types.NUMERIC} + * types. Ignored for all other types. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) throws SQLException; /** - * Sets the database Password for this RowSet. + * Sets the database Password for this {@code RowSet}. This property is used + * when a connection to the database is established. Therefore it should be + * set prior to invoking the {@link #execute} method. * * @param password - * a string holding the new password + * a {@code String} holding the password. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setPassword(String password) throws SQLException; /** - * Sets the Timeout value for this RowSet. The timeout is the maximum time - * that the driver will wait while executing a command - after this time, an - * SQLException is thrown. + * Gets the timeout for the driver when a query operation is executed. If a + * query takes longer than the timeout, a {@code SQLException} is thrown. * * @param seconds - * the number of seconds for the Timeout. + * the number of seconds for the timeout. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setQueryTimeout(int seconds) throws SQLException; /** - * Sets whether the RowSet is read only or is updateable. + * Sets whether the {@code RowSet} is read-only or updatable. * * @param readOnly - * true to set the RowSet to readonly state, false to allow - * updates. + * {@code true} to set the {@code RowSet} to read-only state, + * {@code false} to allow updates. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setReadOnly(boolean readOnly) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied java.sql.Ref. This is sent to the database as an SQL REF value. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code java.sql.Ref}. This is sent to the database as an + * SQL {@code REF} value. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theRef - * the Ref value to set + * the value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @see java.sql.Ref + * @since Android 1.0 */ public void setRef(int parameterIndex, Ref theRef) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied short integer. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code short integer}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theShort - * the short value to set + * the value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setShort(int parameterIndex, short theShort) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied String. The String is placed into the database as a VARCHAR or - * LONGVARCHAR SQL value, depending on the database limits for the length of - * VARCHAR values. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code String}. The string is placed into the database as a + * {@code VARCHAR} or {@code LONGVARCHAR} SQL value, depending on the + * database limits for the length of {@code VARCHAR} values. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theString + * the value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setString(int parameterIndex, String theString) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied java.sql.Time, converting to an SQL TIME value using the system - * default Calendar. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code java.sql.Time}, converting it to an SQL {@code TIME} + * value using the system default {@code Calendar}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theTime - * the Time value to set + * the value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @see java.util.Calendar + * @see java.sql.Time + * @since Android 1.0 */ public void setTime(int parameterIndex, Time theTime) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied java.sql.Time, converting to an SQL TIME value using a supplied - * Calendar. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code java.sql.Time}, converting it to an SQL {@code TIME} + * value using a supplied {@code Calendar}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theTime - * the Time value to set + * the value to which the parameter is set. * @param theCalendar - * the Calendar to use in the conversion operation + * the {@code Calendar} to use in the conversion operation. * @throws SQLException * if an error occurs accessing the database. + * @see java.util.Calendar + * @see java.sql.Time + * @since Android 1.0 */ public void setTime(int parameterIndex, Time theTime, Calendar theCalendar) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied java.sql.Timestamp, converting to an SQL TIMESTAMP value using - * the system default Calendar. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code java.sql.Timestamp}, converting it to an SQL {@code + * TIMESTAMP} value using the system default {@code Calendar}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theTimestamp + * the value to which the parameter is set. * @throws SQLException * if an error occurs accessing the database. + * @see java.util.Calendar + * @see java.sql.Timestamp + * @since Android 1.0 */ public void setTimestamp(int parameterIndex, Timestamp theTimestamp) throws SQLException; /** - * Sets the value of the specified parameter in the RowSet command to a - * supplied java.sql.Timestamp converting to an SQL TIMESTAMP value using a - * supplied Calendar. + * Sets the value of the specified parameter in the {@code RowSet} command + * to a supplied {@code java.sql.Timestamp}, converting it to an SQL {@code + * TIMESTAMP} value using a supplied {@code Calendar}. * * @param parameterIndex - * index of the parameter to set, where the first parameter has - * index = 1. + * the index of the parameter to set; the first parameter's index + * is 1. * @param theTimestamp + * the value to which the parameter is set. * @param theCalendar - * the Calendar to use in the conversion operation + * the {@code Calendar} to use in the conversion operation * @throws SQLException * if an error occurs accessing the database. + * @see java.util.Calendar + * @see java.sql.Timestamp + * @since Android 1.0 */ public void setTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar theCalendar) throws SQLException; /** - * Updates the target instance's transaction isolation level to one of a - * discrete set of possible values. + * Sets the target instance's transaction isolation level to one of a + * discrete set of possible values. The transaction isolation level defines + * the policy implemented on the database for maintaining the data values + * consistent. + * <p> + * Keep in mind that setting a transaction isolation level has no effect + * unless your driver and DBMS support it. + * </p> * * @param level - * the new transaction isolation level. One of: - * Connection.TRANSACTION_READ_UNCOMMITTED, - * Connection.TRANSACTION_READ_COMMITTED, - * Connection.TRANSACTION_REPEATABLE_READ, or - * Connection.TRANSACTION_SERIALIZABLE + * the transaction isolation level. One of: + * <ul> + * <li>{@code Connection.TRANSACTION_READ_UNCOMMITTED}</li> + * <li>{@code Connection.TRANSACTION_READ_COMMITTED}</li> + * <li>{@code Connection.TRANSACTION_REPEATABLE_READ}</li> + * <li>{@code Connection.TRANSACTION_SERIALIZABLE}</li> + * </ul> * @throws SQLException * if an error occurs accessing the database. + * @see java.sql.Connection + * @since Android 1.0 */ public void setTransactionIsolation(int level) throws SQLException; /** - * Sets the type of this RowSet. By default, the type is non-scrollable. + * Sets the type of this {@code RowSet}. By default, the type is + * non-scrollable. * * @param type - * the new type for the RowSet. One of: - * ResultSet.TYPE_FORWARD_ONLY, - * ResultSet.TYPE_SCROLL_INSENSITIVE, or - * ResultSet.TYPE_SCROLL_SENSITIVE + * the type for the {@code RowSet}. One of: + * <ul> + * <li>{@code ResultSet.TYPE_FORWARD_ONLY}</li> + * <li>{@code ResultSet.TYPE_SCROLL_INSENSITIVE}</li> + * <li>{@code ResultSet.TYPE_SCROLL_SENSITIVE}</li> + * </ul> * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setType(int type) throws SQLException; /** - * Sets the Map used to map SQL User Defined Types to Java classes. + * Sets the mapping of SQL User Defined Types (UDTs) to Java classes. The + * Java classes must all implement the {@link java.sql.SQLData SQLData} + * interface. * * @param theTypeMap - * a Map which defines the names of SQL UDTs and the Java classes - * to which they are mapped. + * the names of SQL UDTs and the Java classes to which they are + * mapped. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setTypeMap(Map<String, Class<?>> theTypeMap) throws SQLException; /** - * Sets the URL used by this RowSet to access the database via a - * <code>DriverManager</code>. The URL is optional - an alternative is to - * use a Data Source Name to create a connection. + * Sets the URL used by this {@code RowSet} to access the database via a + * {@code DriverManager}. The URL is optional - an alternative is to use a + * database name to create a connection. * * @param theURL - * a String containing the URL for the database. Can be null. + * the URL for the database. Can be {@code null}. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setUrl(String theURL) throws SQLException; /** - * Sets the Username property for the RowSet, used to authenticate a - * connection to the database. + * Sets the {@code Username} property for the {@code RowSet}, used to + * authenticate a connection to the database. * * @param theUsername - * a String containing the User Name + * the new user name for this row set. * @throws SQLException * if an error occurs accessing the database. + * @since Android 1.0 */ public void setUsername(String theUsername) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/RowSetEvent.java b/sql/src/main/java/javax/sql/RowSetEvent.java index 8682957..9d4c98c 100644 --- a/sql/src/main/java/javax/sql/RowSetEvent.java +++ b/sql/src/main/java/javax/sql/RowSetEvent.java @@ -21,31 +21,36 @@ import java.util.EventObject; import java.io.Serializable; /** - * An event which is sent when specific events happen to a RowSet object. The - * events are sent to inform registered listeners that changes have occurred to - * the RowSet. The events covered are: + * An event which is sent when specific events happen to a {@link RowSet} + * object. The events are sent to inform registered listeners that changes have + * occurred to the {@code RowSet}. The events covered are: * <ol> - * <li>A single row in the RowSet changes</li> - * <li>The whole set of data in the RowSet changes</li> - * <li>The RowSet cursor position changes</li> + * <li>A single row in the {@code RowSet} changes.</li> + * <li>The whole set of data in the {@code RowSet} changes.</li> + * <li>The {@code RowSet} cursor position changes.</li> * </ol> - * The event contains a reference to the RowSet object which generated the - * message so that the listeners can extract whatever information they need from - * that reference. + * <p> + * The event contains a reference to the {@code RowSet} object which generated + * the message so that the listeners can extract whatever information they need + * from that reference. + * </p> * + * @since Android 1.0 */ public class RowSetEvent extends EventObject implements Serializable { private static final long serialVersionUID = -1875450876546332005L; /** - * Creates a RowSetEvent object containing a reference to the RowSet object - * that generated the event. Information about the changes that have - * occurred to the RowSet can be extracted from the RowSet using one or more - * of the query methods available on the RowSet. + * Creates a {@code RowSetEvent} object containing a reference to the + * {@link RowSet} object that generated the event. Information about the + * changes that have occurred to the {@code RowSet} can be extracted from + * the {@code RowSet} using one or more of the query methods available on + * the {@code RowSet}. * * @param theSource - * the RowSet which generated the event + * the {@code RowSet} which generated the event. + * @since Android 1.0 */ public RowSetEvent(RowSet theSource) { super(theSource); diff --git a/sql/src/main/java/javax/sql/RowSetInternal.java b/sql/src/main/java/javax/sql/RowSetInternal.java index f224a13..baa261d 100644 --- a/sql/src/main/java/javax/sql/RowSetInternal.java +++ b/sql/src/main/java/javax/sql/RowSetInternal.java @@ -22,31 +22,35 @@ import java.sql.Connection; import java.sql.ResultSet; /** - * An interface provided by a RowSet object to either a RowSetReader or a - * RowSetWriter, providing facilities to read and update the internal state of - * the RowSet. + * An interface provided by a {@code RowSet} object to let either a {@code RowSetReader} or a + * {@code RowSetWriter} access its internal state, thereby providing facilities to read and update the state of + * the {@code RowSet}. */ public interface RowSetInternal { /** - * Gets the Connection associated with this RowSet object. + * Gets the connection associated with this {@code RowSet} object. * - * @return the Connection + * @return the connection or {@code null}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public Connection getConnection() throws SQLException; /** - * Gets the ResultSet that was the original (unmodified) content of the - * RowSet. + * Gets the {@code ResultSet} that was the original (unmodified) content of + * the {@code RowSet}. * <p> - * The ResultSet cursor is positioned before the first row of data + * The {@code ResultSet}'s cursor is positioned before the first row of + * data. + * </p> * - * @return the ResultSet that contained the original data value of the - * RowSet + * @return the {@code ResultSet} that contained the original data value of + * the {@code RowSet}. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public ResultSet getOriginal() throws SQLException; @@ -54,33 +58,36 @@ public interface RowSetInternal { * Gets the original value of the current row only. If the current row did * not have an original value, then an empty value is returned. * - * @return a ResultSet containing the value of the current row only. + * @return a {@code ResultSet} containing the value of the current row only. * @throws SQLException * if there is a problem accessing the database, or if the - * cursor is not on a valid row (before first, after last or - * pointing to the insert row). + * cursor is not on a valid row (before the first row, after the + * last one or pointing to the insert row). + * @since Android 1.0 */ public ResultSet getOriginalRow() throws SQLException; /** - * Gets the parameter values that have been set for this RowSet's command. + * Gets the parameter values that have been set for this {@code RowSet}'s + * command. * - * @return an Object array containing the values of parameters that have - * been set. + * @return the values of parameters that have been set. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public Object[] getParams() throws SQLException; /** - * Sets RowSetMetaData for this RowSet. The RowSetMetaData is used by a - * RowSetReader to set values giving information about the RowSet's columns. + * Sets {@code RowSetMetaData} for this {@code RowSet}. The {@code + * RowSetMetaData} is used by a {@code RowSetReader} to set values giving + * information about the {@code RowSet}'s columns. * * @param theMetaData - * a RowSetMetaData holding the metadata about the RowSet's - * columns. + * holds the metadata about the {@code RowSet}'s columns. * @throws SQLException * if there is a problem accessing the database. + * @since Android 1.0 */ public void setMetaData(RowSetMetaData theMetaData) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/RowSetListener.java b/sql/src/main/java/javax/sql/RowSetListener.java index a482d2b..06a7253 100644 --- a/sql/src/main/java/javax/sql/RowSetListener.java +++ b/sql/src/main/java/javax/sql/RowSetListener.java @@ -20,43 +20,53 @@ package javax.sql; import java.util.EventListener; /** - * An interface used to send notification of events occurring in a RowSet. To - * receive the notification events, an object must implement the RowSetListener - * interface and then register itself with the RowSet of interest using the - * <code>RowSet.addRowSetListener</code> method. + * An interface used to send notification of events occurring in the context of + * a {@link RowSet}. To receive the notification events, an object must + * implement the {@code RowSetListener} interface and then register itself with + * the {@code RowSet} of interest using the + * {@link RowSet#addRowSetListener(RowSetListener)} method. + * + * @since Android 1.0 */ public interface RowSetListener extends EventListener { /** - * Notifies the listener that one of the RowSet's rows has changed. + * Notifies the listener that the {@code RowSet}'s cursor in {@code + * theEvent.getSource} has moved. * * @param theEvent - * a RowSetEvent that contains information about the RowSet - * involved. This information can be used to retrieve information - * about the change, such as the new cursor position. + * a {@code RowSetEvent} that contains information about the + * {@code RowSet} involved. This information can be used to + * retrieve information about the change, such as the updated + * data values. + * @since Android 1.0 */ public void cursorMoved(RowSetEvent theEvent); /** - * Notifies the listener that the RowSet's cursor has moved. + * Notifies the listener that one of the {@code RowSet}'s rows in {@code + * theEvent.getSource} has changed. * * @param theEvent - * theEvent a RowSetEvent that contains information about the - * RowSet involved. This information can be used to retrieve - * information about the change, such as the updated data values. + * a {@code RowSetEvent} that contains information about the + * {@code RowSet} involved. This information can be used to + * retrieve information about the change, such as the new cursor + * position. + * @since Android 1.0 */ public void rowChanged(RowSetEvent theEvent); /** - * Notifies the listener that the RowSet's entire contents have been updated - * (an example is the execution of a command which retrieves new data from - * the database). + * Notifies the listener that the {@code RowSet}'s entire contents in + * {@code theEvent.getSource} have been updated (an example is the execution + * of a command which retrieves new data from the database). * * @param theEvent - * theEvent a RowSetEvent that contains information about the - * RowSet involved. This information can be used to retrieve - * information about the change, such as the updated rows of - * data. + * a {@code RowSetEvent} that contains information about the + * {@code RowSet} involved. This information can be used to + * retrieve information about the change, such as the updated + * rows of data. + * @since Android 1.0 */ public void rowSetChanged(RowSetEvent theEvent); } diff --git a/sql/src/main/java/javax/sql/RowSetMetaData.java b/sql/src/main/java/javax/sql/RowSetMetaData.java index 89d6f7f..3051876 100644 --- a/sql/src/main/java/javax/sql/RowSetMetaData.java +++ b/sql/src/main/java/javax/sql/RowSetMetaData.java @@ -22,261 +22,292 @@ import java.sql.SQLException; /** * An interface which provides facilities for getting information about the - * columns in a RowSet. + * columns in a {@code RowSet}. * <p> - * RowSetMetaData extends ResultSetMetaData, adding new operations for carrying - * out value sets. + * {@code RowSetMetaData} extends {@link java.sql.ResultSetMetaData}, adding new + * operations for carrying out value sets. + * </p> * <p> * Application code would not normally call this interface directly. It would be - * called internally when <code>RowSet.execute</code> is called. + * called internally when {@code RowSet.execute} is called. + * </p> + * + * @see RowSetInternal#setMetaData(RowSetMetaData) + * @since Android 1.0 */ public interface RowSetMetaData extends ResultSetMetaData { /** - * Sets automatic numbering for a specified column in the RowSet. If - * automatic numbering is on, the column is read only. The default value is - * for automatic numbering to be off. + * Sets automatic numbering for a specified column in the {@code RowSet}. If + * automatic numbering is on, the column is read-only. The default value for + * the auto increment parameter is {@code false}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param autoIncrement - * true to set automatic numbering on, false to turn it off. + * {@code true} to set automatic numbering on, {@code false} to + * turn it off (default). * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setAutoIncrement(int columnIndex, boolean autoIncrement) throws SQLException; /** - * Sets the case sensitive property for a specified column in the RowSet. - * The default is that the column is not case sensitive. + * Sets the case sensitive property for a specified column in the {@code + * RowSet}. The default is that the column is not case sensitive. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param caseSensitive - * true to make the column case sensitive, false to make it not - * case sensitive. + * {@code true} to make the column case sensitive, {@code false} + * to make it case insensitive (default). * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setCaseSensitive(int columnIndex, boolean caseSensitive) throws SQLException; /** - * Sets the Catalog Name for a specified column in the RowSet. + * Sets the catalog name for a specified column in the {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param catalogName - * a string containing the new Catalog Name + * the new catalog's name. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setCatalogName(int columnIndex, String catalogName) throws SQLException; /** - * Sets the number of columns in the Row Set. + * Sets the number of columns contained in the row set. * * @param columnCount - * an integer containing the number of columns in the RowSet. + * the number of columns contained in the {@code RowSet}. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnCount(int columnCount) throws SQLException; /** * Sets the normal maximum width in characters for a specified column in the - * RowSet. + * {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param displaySize - * an integer with the normal maximum column width in characters + * the normal maximum column width in characters. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnDisplaySize(int columnIndex, int displaySize) throws SQLException; /** + * Sets the suggested name as label for the column contained in the {@code + * RowSet}. The label is an alias for printing and displaying purposes. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theLabel + * the alias name for the column. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnLabel(int columnIndex, String theLabel) throws SQLException; /** - * Sets the suggested column label for a specified column in the RowSet. - * This label is typically used in displaying or printing the column. + * Sets the column name for a specified column in the {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theColumnName - * a string containing the column label + * the column's label. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnName(int columnIndex, String theColumnName) throws SQLException; /** - * Sets the SQL type for a specified column in the RowSet + * Sets the SQL type for a specified column in the {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theSQLType - * an integer containing the SQL Type, as defined by - * java.sql.Types. + * the SQL Type, as defined by {@code java.sql.Types}. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnType(int columnIndex, int theSQLType) throws SQLException; /** - * Sets the Type Name for a specified column in the RowSet, where the data - * type is specific to the datasource. + * Sets the type name for a specified column in the {@code RowSet}, where + * the data type is specific to the data source. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theTypeName - * a string containing the Type Name for the column + * the SQL type name for the column. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setColumnTypeName(int columnIndex, String theTypeName) throws SQLException; /** - * Sets whether a specified column is a currency value. + * Sets whether a specified column is a currency value. The default value is + * {@code false}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param isCurrency - * true if the column should be treated as a currency value, - * false if it should not be treated as a currency value. + * {@code true} if the column should be treated as a currency + * value, {@code false} if it should not be treated as a currency + * value (default). * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setCurrency(int columnIndex, boolean isCurrency) throws SQLException; /** - * Sets whether a specified column can contain SQL NULL values. + * Sets whether a specified column can contain SQL {@code NULL} values. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param nullability * an integer which is one of the following values: - * ResultSetMetaData.columnNoNulls, - * ResultSetMetaData.columnNullable, or - * ResultSetMetaData.columnNullableUnknown + * <ul> + * <li>{@code ResultSetMetaData.columnNoNulls}</li> + * <li>{@code ResultSetMetaData.columnNullable}</li> + * <li>{@code ResultSetMetaData.columnNullableUnknown}</li> + * </ul> * <p> - * The default value is ResultSetMetaData.columnNullableUnknown + * The default value is {@code + * ResultSetMetaData.columnNullableUnknown}. + * </p> * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setNullable(int columnIndex, int nullability) throws SQLException; /** - * Sets the number of decimal digits for a specified column in the RowSet. + * Sets the number of decimal digits for a specified column in the {@code + * RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param thePrecision - * an integer containing the number of decimal digits + * the number of decimal digits. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setPrecision(int columnIndex, int thePrecision) throws SQLException; /** - * For the column specified by <code>columnIndex</code> declares how many - * digits there should be after a decimal point. + * Declares how many decimal digits there should be after a decimal point + * for the column specified by {@code columnIndex}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theScale - * an integer containing the number of digits after the decimal - * point + * the number of digits after the decimal point. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setScale(int columnIndex, int theScale) throws SQLException; /** - * Sets the Schema Name for a specified column in the RowSet + * Sets the schema name for a specified column in the {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theSchemaName - * a String containing the schema name + * a {@code String} containing the schema name. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setSchemaName(int columnIndex, String theSchemaName) throws SQLException; /** - * Sets whether a specified column can be used in a search involving a WHERE - * clause. The default value is false. + * Sets whether a specified column can be used in a search involving a + * {@code WHERE} clause. The default value is {@code false}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param isSearchable - * true of the column can be used in a WHERE clause search, false - * otherwise. + * {@code true} of the column can be used in a {@code WHERE} + * clause search, {@code false} otherwise. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setSearchable(int columnIndex, boolean isSearchable) throws SQLException; /** - * Sets if a specified column can contain signed numbers + * Sets if a specified column can contain signed numbers. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param isSigned - * true if the column can contain signed numbers, false otherwise + * {@code true} if the column can contain signed numbers, {@code + * false} otherwise. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setSigned(int columnIndex, boolean isSigned) throws SQLException; /** - * Sets the Table Name for a specified column in the RowSet + * Sets the table name for a specified column in the {@code RowSet}. * * @param columnIndex - * the index number for the column, where the first column has - * index 1. + * the index number for the column; the first column's index is + * 1. * @param theTableName - * a String containing the Table Name for the column + * the table name for the column. * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public void setTableName(int columnIndex, String theTableName) throws SQLException; diff --git a/sql/src/main/java/javax/sql/RowSetReader.java b/sql/src/main/java/javax/sql/RowSetReader.java index bc17ded..d4a902f 100644 --- a/sql/src/main/java/javax/sql/RowSetReader.java +++ b/sql/src/main/java/javax/sql/RowSetReader.java @@ -20,31 +20,40 @@ package javax.sql; import java.sql.SQLException; /** - * An interface which provides functionality for a disconnected RowSet to get - * data from a data source into its rows. The RowSet calls the RowSetReader - * interface when the RowSet's execute method is invoked - a RowSetReader must - * first be registered with the RowSet for this to work. + * An interface which provides functionality for a disconnected {@code RowSet} + * to get data from a database into its rows. The {@code RowSet} calls the + * {@code RowSetReader} interface when the {@code RowSet}'s execute method is + * invoked - a {@code RowSetReader} must first be registered with the {@code + * RowSet} for this to work. + * + * @see RowSet + * @since Android 1.0 */ public interface RowSetReader { /** - * Reads new data into the RowSet. The calling RowSet object must itself - * implement the RowSetInternal interface and the RowSetReader must be - * registered as a Reader on the RowSet. + * Reads new data into the {@code RowSet}. The calling {@code RowSet} object + * must itself implement the {@code RowSetInternal} interface and the + * {@code RowSetReader} must be registered as a reader on the + * {@code RowSet}. * <p> - * This method adds rows into the calling RowSet. The Reader may invoke any - * of the RowSet's methods except for the <code>execute</code> method - * (calling execute will cause an SQLException to be thrown). However, when - * the Reader calls the RowSet's methods, no events are sent to listeners - - * any listeners are informed by the calling RowSet's execute method once - * the Reader returns from the readData method. + * This method adds rows into the calling {@code RowSet}. The reader may + * invoke any of the {@code RowSet}'s methods except for the {@code execute} + * method (calling {@code execute} will cause an {@code SQLException} to be + * thrown). However, when the reader calls the {@code RowSet}'s methods, no + * events are sent to listeners - any listeners are informed by the calling + * {@code RowSet}'s {@code execute} method once the reader returns from the + * {@code readData} method. + * </p> * * @param theCaller - * must be the calling RowSet object, which must have implemented - * the RowSetInternal interface. + * must be the calling {@code RowSet} object, which must have + * implemented the {@code RowSetInternal} interface. * @throws SQLException - * if a problem occurs accessing the database or if the Reader - * calls the RowSet.execute method. + * if a problem occurs accessing the database or if the reader + * calls the {@link RowSet#execute()} method. + * @see RowSetInternal + * @since Android 1.0 */ public void readData(RowSetInternal theCaller) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/RowSetWriter.java b/sql/src/main/java/javax/sql/RowSetWriter.java index ba95f59..34473b2 100644 --- a/sql/src/main/java/javax/sql/RowSetWriter.java +++ b/sql/src/main/java/javax/sql/RowSetWriter.java @@ -20,33 +20,43 @@ package javax.sql; import java.sql.SQLException; /** - * An interface which provides functionality for a disconnected RowSet to put - * data updates back to the data source from which the RowSet was originally - * populated. An object implementing this interface is called a Writer. + * An interface which provides functionality for a disconnected {@code RowSet} + * to put data updates back to the data source from which the {@code RowSet} was + * originally populated. An object implementing this interface is called a + * writer. * <p> - * The Writer must establish a connection to the RowSet's data source before - * writing the data. The RowSet calling this interface must implement the - * RowSetInternal interface. + * The writer must establish a connection to the {@code RowSet}'s database + * before writing the data. The {@code RowSet} calling this interface must + * implement the {@code RowSetInternal} interface. + * </p> * <p> - * The Writer may encounter a situation where the updated data being written - * back to the data source has already been updated in the data source. How a - * conflict of this kind is handled is determined by the implementation of the - * Writer. + * The writer may encounter a situation where the updated data needs to be + * written back to the database, but has already been updated there in the mean + * time. How a conflict of this kind is handled is determined by the + * implementation of this writer. + * </p> + * + * @see RowSetInternal + * @since Android 1.0 */ public interface RowSetWriter { /** - * Writes changes in the RowSet associated with this RowSetWriter back to - * its data source. + * Writes changes made in the {@code RowSet}, which is associated with this + * {@code RowSetWriter}, back to the database. * * @param theRowSet - * the RowSet object. This RowSet must a) Implement the - * RowSetInternal interface and b) have have this RowSetWriter - * registered with it and c) must call this method internally - * @return true if the modified data was written, false otherwise (which - * typically implies some form of conflict) + * a row set that fulfills the following criteria: + * <ul> + * <li>it must implement the {@code RowSetInternal} interface,</li> + * <li>have this {@code RowSetWriter} registered with it,</li> + * <li>must call this method internally.</li> + * </ul> + * @return {@code true} if the modified data was written, {@code false} + * otherwise (which typically implies some form of conflict). * @throws SQLException - * if a problem occurs accessing the database + * if a problem occurs accessing the database. + * @since Android 1.0 */ public boolean writeData(RowSetInternal theRowSet) throws SQLException; } diff --git a/sql/src/main/java/javax/sql/package.html b/sql/src/main/java/javax/sql/package.html index c5d5aee..6c9500f 100644 --- a/sql/src/main/java/javax/sql/package.html +++ b/sql/src/main/java/javax/sql/package.html @@ -4,5 +4,6 @@ Provides extensions to the standard interface for accessing SQL-based databases. <p> + @since Android 1.0 </body> </html>
\ No newline at end of file diff --git a/sql/src/main/java/org/apache/harmony/sql/internal/nls/Messages.java b/sql/src/main/java/org/apache/harmony/sql/internal/nls/Messages.java index 77b669b..b3dbd32 100644 --- a/sql/src/main/java/org/apache/harmony/sql/internal/nls/Messages.java +++ b/sql/src/main/java/org/apache/harmony/sql/internal/nls/Messages.java @@ -21,9 +21,22 @@ * if this tool runs again. Better make changes in the template file. */ +// BEGIN android-note +// Redundant code has been removed and is now called from MsgHelp. +// END android-note + package org.apache.harmony.sql.internal.nls; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +// BEGIN android-changed import org.apache.harmony.luni.util.MsgHelp; +// END android-changed /** * This class retrieves strings from a resource bundle and returns them, @@ -41,8 +54,10 @@ import org.apache.harmony.luni.util.MsgHelp; */ public class Messages { + // BEGIN android-changed private static final String sResource = "org.apache.harmony.sql.internal.nls.messages"; //$NON-NLS-1$ + // END android-changed /** * Retrieves a message which has no arguments. @@ -52,7 +67,9 @@ public class Messages { * @return String the message for that key in the system message bundle. */ static public String getString(String msg) { + // BEGIN android-changed return MsgHelp.getString(sResource, msg); + // END android-changed } /** @@ -119,6 +136,12 @@ public class Messages { * @return String the message for that key in the system message bundle. */ static public String getString(String msg, Object[] args) { + // BEGIN android-changed return MsgHelp.getString(sResource, msg, args); + // END android-changed } + + // BEGIN android-note + // Duplicate code was dropped in favor of using MsgHelp. + // END android-note } diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java index 241888a..17391c6 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.Serializable; import java.sql.BatchUpdateException; import java.util.Arrays; @@ -26,11 +31,21 @@ import junit.framework.TestCase; import org.apache.harmony.testframework.serialization.SerializationTest; import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert; +@TestTargetClass(BatchUpdateException.class) public class BatchUpdateExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "BatchUpdateException", + methodArgs = {} + ) + }) public void testBatchUpdateException() { int[] theFinalStates1 = { 0 }; // Error Code state @@ -75,6 +90,15 @@ public class BatchUpdateExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "BatchUpdateException", + methodArgs = {int[].class} + ) + }) public void testBatchUpdateExceptionintArray() { int[][] init1 = { { 1, 2, 3 }, null }; @@ -121,6 +145,15 @@ public class BatchUpdateExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "BatchUpdateException", + methodArgs = {String.class, int[].class} + ) + }) public void testBatchUpdateExceptionStringintArray() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "", @@ -176,6 +209,15 @@ public class BatchUpdateExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "BatchUpdateException", + methodArgs = {String.class, String.class, int[].class} + ) + }) public void testBatchUpdateExceptionStringStringintArray() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "", @@ -233,6 +275,15 @@ public class BatchUpdateExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "BatchUpdateException", + methodArgs = {String.class, String.class, int.class, int[].class} + ) + }) public void testBatchUpdateExceptionStringStringintintArray() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "", @@ -291,6 +342,15 @@ public class BatchUpdateExceptionTest extends TestCase { /* * Method test for getUpdateCounts */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getUpdateCounts", + methodArgs = {} + ) + }) public void testGetUpdateCounts() { BatchUpdateException aBatchUpdateException; @@ -344,6 +404,15 @@ public class BatchUpdateExceptionTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationSelf", + methodArgs = {} + ) + }) public void testSerializationSelf() throws Exception { BatchUpdateException object = new BatchUpdateException(); SerializationTest.verifySelf(object, BATCHUPDATEEXCEPTION_COMPARATOR); @@ -352,6 +421,15 @@ public class BatchUpdateExceptionTest extends TestCase { /** * @tests serialization/deserialization compatibility with RI. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationGolden", + methodArgs = {} + ) + }) public void testSerializationCompatibility() throws Exception { int vendorCode = 10; int[] updateCounts = { 1, 2, 3, 4 }; diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java index 22409f7..1e5573a 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.Connection.class) public class ConnectionTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java index 624da41..5eaef52 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.Serializable; import java.sql.DataTruncation; import org.apache.harmony.testframework.serialization.SerializationTest; @@ -24,11 +29,21 @@ import org.apache.harmony.testframework.serialization.SerializationTest.Serializ import junit.framework.TestCase; +@TestTargetClass(DataTruncation.class) public class DataTruncationTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "DataTruncation", + methodArgs = {int.class, boolean.class, boolean.class, int.class, int.class} + ) + }) public void testDataTruncationintbooleanbooleanintint() { int[] init1 = { -2147483648, 2147483647, 0, 329751502, 318587557, @@ -96,6 +111,15 @@ public class DataTruncationTest extends TestCase { /* * Method test for getIndex */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getIndex", + methodArgs = {} + ) + }) public void testGetIndex() { DataTruncation aDataTruncation; @@ -168,6 +192,15 @@ public class DataTruncationTest extends TestCase { /* * Method test for getParameter */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getParameter", + methodArgs = {} + ) + }) public void testGetParameter() { DataTruncation aDataTruncation; @@ -240,6 +273,15 @@ public class DataTruncationTest extends TestCase { /* * Method test for getRead */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getRead", + methodArgs = {} + ) + }) public void testGetRead() { DataTruncation aDataTruncation; @@ -312,6 +354,15 @@ public class DataTruncationTest extends TestCase { /* * Method test for getDataSize */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDataSize", + methodArgs = {} + ) + }) public void testGetDataSize() { DataTruncation aDataTruncation; @@ -384,6 +435,15 @@ public class DataTruncationTest extends TestCase { /* * Method test for getTransferSize */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getTransferSize", + methodArgs = {} + ) + }) public void testGetTransferSize() { DataTruncation aDataTruncation; @@ -456,6 +516,15 @@ public class DataTruncationTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationSelf", + methodArgs = {} + ) + }) public void testSerializationSelf() throws Exception { DataTruncation object = new DataTruncation(10, true, true, 10, 10); SerializationTest.verifySelf(object, DATATRUNCATION_COMPARATOR); @@ -464,6 +533,15 @@ public class DataTruncationTest extends TestCase { /** * @tests serialization/deserialization compatibility with RI. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationGolden", + methodArgs = {} + ) + }) public void testSerializationCompatibility() throws Exception { DataTruncation object = new DataTruncation(10, true, true, 10, 10); SerializationTest.verifyGolden(this, object, DATATRUNCATION_COMPARATOR); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java index c970c70..d6fa92d 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.DatabaseMetaData.class) public class DatabaseMetaDataTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Number> thePublicStatics = new HashMap<String, Number>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java index 903b77f..79bfc6c 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java @@ -17,12 +17,17 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Date; import java.util.Calendar; import java.util.TimeZone; import junit.framework.TestCase; - +@TestTargetClass(Date.class) /** * JUnit Testcase for the java.sql.Date class * @@ -124,6 +129,15 @@ public class DateTest extends TestCase { /* * Test of the Date( long ) constructor */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "Date", + methodArgs = {long.class} + ) + }) public void testDatelong() { long init1[] = { TIME_TESTDATE1, TIME_TESTDATE2, TIME_TESTDATE3, @@ -141,6 +155,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) int Date.getHours() method - which always throws * an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getHours", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetHours() { Date theDate = new Date(TIME_TESTDATE1); @@ -156,6 +179,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) int Date.getMinutes() method - which always * throws an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getMinutes", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetMinutes() { Date theDate = new Date(TIME_TESTDATE1); @@ -171,6 +203,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) int Date.getSeconds() method - which always * throws an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getSeconds", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetSeconds() { Date theDate = new Date(TIME_TESTDATE1); @@ -186,6 +227,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) Date.setHours( int ) method - which always * throws an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setHours", + methodArgs = {int.class} + ) + }) @SuppressWarnings("deprecation") public void testSetHours() { Date theDate = new Date(TIME_TESTDATE1); @@ -201,6 +251,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) Date.setMinutes( int ) method - which always * throws an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setMinutes", + methodArgs = {int.class} + ) + }) @SuppressWarnings("deprecation") public void testSetMinutes() { Date theDate = new Date(TIME_TESTDATE1); @@ -217,6 +276,15 @@ public class DateTest extends TestCase { * Test of the (deprecated) Date.setSeconds( int ) method - which always * throws an IllegalArgumentException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setSeconds", + methodArgs = {int.class} + ) + }) @SuppressWarnings("deprecation") public void testSetSeconds() { Date theDate = new Date(TIME_TESTDATE1); @@ -233,6 +301,15 @@ public class DateTest extends TestCase { * time zone setting and this test sets the time zone before calling the * toString() method. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "toString", + methodArgs = {} + ) + }) public void testToString() { // This test is set up for GMT time zone, so need to set the time zone // to GMT first @@ -250,6 +327,15 @@ public class DateTest extends TestCase { * settings and sets up the time zone to one of a group of specific time * zones and tests the method using each of these time zones in turn. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {long.class} + ) + }) public void testSetTimelong() { // Loop over the array of test timezones @@ -262,6 +348,15 @@ public class DateTest extends TestCase { /* * Internal method for testing Date.setTime with a specific time zone */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {long.class} + ) + }) private void testSetTimelong(String timeZoneName, String[] dateArray) { if (timeZoneName != null) { @@ -282,6 +377,15 @@ public class DateTest extends TestCase { * Test of the Date.valueOf( String ) method This test is not dependent on * the default Time Zone setting */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void testValueOf() { String SQL_NOTVALID1 = "ABCDEF"; // Invalid date string String SQL_NOTVALID2 = "12321.43.56"; // Invalid date string @@ -310,6 +414,15 @@ public class DateTest extends TestCase { /** * @tests java.sql.Date#valueOf(String ) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void test_valueOf_IllegalArgumentException() { try{ Date.valueOf("1996-10-07-01"); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java index 73b415b..2f14290 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.PrintWriter; @@ -31,7 +36,7 @@ import java.util.Enumeration; import java.util.Properties; import junit.framework.TestCase; - +@TestTargetClass(DriverManager.class) /** * JUnit Testcase for the java.sql.DriverManager class * @@ -75,6 +80,15 @@ public class DriverManagerTest extends TestCase { * Test for the method DriverManager.deregisterDriver * @throws SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "deregisterDriver", + methodArgs = {Driver.class} + ) + }) public void testDeregisterDriver() throws SQLException { // First get one of the drivers loaded by the test Driver aDriver; @@ -159,6 +173,15 @@ public class DriverManagerTest extends TestCase { static String[] invalidConnectionURLs = { invalidConnectionURL2, invalidConnectionURL3 }; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {String.class} + ) + }) public void testGetConnectionString() throws SQLException { Connection theConnection = null; // validConnection - no user & password required @@ -180,6 +203,15 @@ public class DriverManagerTest extends TestCase { /** * @tests java.sql.DriverManager#getConnection(String, Properties) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {String.class, Properties.class} + ) + }) public void test_getConnection_LStringLProperties() { try { DriverManager.getConnection("fff", //$NON-NLS-1$ @@ -201,6 +233,15 @@ public class DriverManagerTest extends TestCase { /* * Class under test for Connection getConnection(String, Properties) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {String.class, Properties.class} + ) + }) public void testGetConnectionStringProperties() throws SQLException { String validURL1 = "jdbc:mikes1:data2"; String validuser1 = "theuser"; @@ -247,6 +288,15 @@ public class DriverManagerTest extends TestCase { /* * Class under test for Connection getConnection(String, String, String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {String.class, String.class, String.class} + ) + }) public void testGetConnectionStringStringString() throws SQLException { String validURL1 = "jdbc:mikes1:data2"; String validuser1 = "theuser"; @@ -298,6 +348,15 @@ public class DriverManagerTest extends TestCase { static String exceptionMsg1 = "No suitable driver"; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDriver", + methodArgs = {String.class} + ) + }) public void testGetDriver() throws SQLException { for (String element : validURLs) { Driver validDriver = DriverManager.getDriver(element); @@ -316,6 +375,15 @@ public class DriverManagerTest extends TestCase { } // end method testGetDriver() + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDrivers", + methodArgs = {} + ) + }) public void testGetDrivers() { // Load a driver manager Enumeration<Driver> driverList = DriverManager.getDrivers(); @@ -333,11 +401,29 @@ public class DriverManagerTest extends TestCase { static int timeout1 = 25; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getLoginTimeout", + methodArgs = {} + ) + }) public void testGetLoginTimeout() { DriverManager.setLoginTimeout(timeout1); assertEquals(timeout1, DriverManager.getLoginTimeout()); } // end method testGetLoginTimeout() + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getLogStream", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetLogStream() { assertNull(DriverManager.getLogStream()); @@ -348,6 +434,15 @@ public class DriverManagerTest extends TestCase { DriverManager.setLogStream(null); } // end method testGetLogStream() + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getLogWriter", + methodArgs = {} + ) + }) public void testGetLogWriter() { assertNull(DriverManager.getLogWriter()); @@ -360,6 +455,15 @@ public class DriverManagerTest extends TestCase { static String testMessage = "DriverManagerTest: test message for print stream"; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "println", + methodArgs = {String.class} + ) + }) @SuppressWarnings("deprecation") public void testPrintln() { // System.out.println("testPrintln"); @@ -384,6 +488,15 @@ public class DriverManagerTest extends TestCase { DriverManager.setLogStream(null); } // end method testPrintln() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException/ClassNotFoundException checking missed", + targets = { + @TestTarget( + methodName = "registerDriver", + methodArgs = {Driver.class} + ) + }) public void testRegisterDriver() throws ClassNotFoundException, SQLException, IllegalAccessException, InstantiationException { String EXTRA_DRIVER_NAME = "org.apache.harmony.sql.tests.java.sql.TestHelper_Driver3"; @@ -414,6 +527,15 @@ public class DriverManagerTest extends TestCase { static int invalidTimeout1 = -10; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setLoginTimeout", + methodArgs = {int.class} + ) + }) public void testSetLoginTimeout() { for (int element : validTimeouts) { DriverManager.setLoginTimeout(element); @@ -429,6 +551,15 @@ public class DriverManagerTest extends TestCase { static PrintStream testPrintStream = new PrintStream(outputStream2); + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setLogStream", + methodArgs = {PrintStream.class} + ) + }) @SuppressWarnings("deprecation") public void testSetLogStream() { // System.out.println("testSetLogStream"); @@ -468,6 +599,15 @@ public class DriverManagerTest extends TestCase { /** * Test for the setLogWriter method */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setLogWriter", + methodArgs = {PrintWriter.class} + ) + }) public void testSetLogWriter() { // System.out.println("testSetLogWriter"); DriverManager.setLogWriter(testPrintWriter); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java index ec38988..8e93cbe 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java @@ -17,11 +17,16 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.DriverPropertyInfo; import java.util.Arrays; import junit.framework.TestCase; - +@TestTargetClass(DriverPropertyInfo.class) /** * JUnit Testcase for the java.sql.DriverPropertyInfo class * @@ -32,6 +37,15 @@ public class DriverPropertyInfoTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "", + methodArgs = {} + ) + }) public void testPublicStatics() { } // end method testPublicStatics @@ -39,6 +53,15 @@ public class DriverPropertyInfoTest extends TestCase { /* * Constructor test */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verification with invalid parameters missed", + targets = { + @TestTarget( + methodName = "DriverPropertyInfo", + methodArgs = {String.class, String.class} + ) + }) public void testDriverPropertyInfoStringString() { DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo( @@ -67,6 +90,15 @@ public class DriverPropertyInfoTest extends TestCase { static String updateName = "updateName"; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicFields() { // Constructor here... diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java index d3e000d..a455af4 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.ParameterMetaData.class) public class ParameterMetaDataTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java index 07a25c2..3385ba3 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.ResultSetMetaData.class) public class ResultSetMetaDataTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java index 26e61fe..cf13929 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.ResultSet.class) public class ResultSetTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java index bb73343..9ce2e99 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.Serializable; import java.lang.reflect.Field; import java.sql.SQLException; @@ -27,6 +32,7 @@ import org.apache.harmony.testframework.serialization.SerializationTest.Serializ import junit.framework.Assert; import junit.framework.TestCase; +@TestTargetClass(SQLException.class) public class SQLExceptionTest extends TestCase { static long theFixedSUID = 2135244094396331484L; @@ -34,6 +40,15 @@ public class SQLExceptionTest extends TestCase { /* * SUID test */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testSUID() { try { @@ -52,6 +67,15 @@ public class SQLExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLException", + methodArgs = {String.class, String.class, int.class} + ) + }) public void testSQLExceptionStringStringint() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", "1", "a", @@ -104,6 +128,15 @@ public class SQLExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLException", + methodArgs = {String.class, String.class} + ) + }) public void testSQLExceptionStringString() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "", @@ -154,6 +187,15 @@ public class SQLExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLException", + methodArgs = {String.class} + ) + }) public void testSQLExceptionString() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, @@ -203,6 +245,15 @@ public class SQLExceptionTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLException", + methodArgs = {} + ) + }) public void testSQLException() { String[] theFinalStates1 = { null }; @@ -245,6 +296,15 @@ public class SQLExceptionTest extends TestCase { /* * Method test for getErrorCode */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getErrorCode", + methodArgs = {} + ) + }) public void testGetErrorCode() { SQLException aSQLException; @@ -298,6 +358,15 @@ public class SQLExceptionTest extends TestCase { /* * Method test for getNextException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getNextException", + methodArgs = {} + ) + }) public void testGetNextException() { SQLException aSQLException; @@ -354,6 +423,15 @@ public class SQLExceptionTest extends TestCase { /* * Method test for getSQLState */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getSQLState", + methodArgs = {} + ) + }) public void testGetSQLState() { SQLException aSQLException; @@ -407,6 +485,15 @@ public class SQLExceptionTest extends TestCase { /* * Method test for setNextException */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setNextException", + methodArgs = {SQLException.class} + ) + }) public void testSetNextExceptionSQLException() { SQLException[] parm1 = { new SQLException(), null, new SQLException(), @@ -461,6 +548,15 @@ public class SQLExceptionTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationSelf", + methodArgs = {} + ) + }) public void testSerializationSelf() throws Exception { SQLException object = new SQLException(); SerializationTest.verifySelf(object, SQLEXCEPTION_COMPARATOR); @@ -469,6 +565,15 @@ public class SQLExceptionTest extends TestCase { /** * @tests serialization/deserialization compatibility with RI. */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationGolden", + methodArgs = {} + ) + }) public void testSerializationCompatibility() throws Exception { SQLException nextSQLException = new SQLException("nextReason", @@ -516,6 +621,15 @@ public class SQLExceptionTest extends TestCase { /** * @tests java.sql.SQLException#setNextException(java.sql.SQLException) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setNextException", + methodArgs = {SQLException.class} + ) + }) public void test_setNextException_LSQLException() { SQLException se1 = new SQLException("reason" , "SQLState" , 1); SQLException se2 = new SQLException("reason" , "SQLState" , 2); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java index 0cf1d45..00f33e8 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java @@ -17,10 +17,15 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.SQLPermission; import junit.framework.TestCase; - +@TestTargetClass(SQLPermission.class) /** * JUnit Testcase for the java.sql.SQLPermission class * @@ -35,6 +40,15 @@ public class SQLPermissionTest extends TestCase { /* * Constructor test */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Null/invalid parameters checking missed", + targets = { + @TestTarget( + methodName = "SQLPermission", + methodArgs = {String.class, String.class} + ) + }) public void testSQLPermissionStringString() { String validName = "setLog"; String validActions = "theActions"; @@ -51,6 +65,15 @@ public class SQLPermissionTest extends TestCase { /* * Constructor test */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Null parameter checking missed", + targets = { + @TestTarget( + methodName = "SQLPermission", + methodArgs = {String.class} + ) + }) public void testSQLPermissionString() { String validName = "setLog"; diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java index d0998ce..eb35062 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.Serializable; import java.sql.SQLException; import java.sql.SQLWarning; @@ -26,11 +31,21 @@ import org.apache.harmony.testframework.serialization.SerializationTest.Serializ import junit.framework.TestCase; +@TestTargetClass(SQLWarning.class) public class SQLWarningTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {} + ) + }) public void testSQLWarning() { String[] theFinalStates1 = { null }; @@ -73,6 +88,15 @@ public class SQLWarningTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {String.class} + ) + }) public void testSQLWarningString() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, @@ -121,6 +145,15 @@ public class SQLWarningTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {String.class, String.class} + ) + }) public void testSQLWarningStringString() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "", @@ -170,6 +203,15 @@ public class SQLWarningTest extends TestCase { /* * ConstructorTest */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {String.class, String.class, int.class} + ) + }) public void testSQLWarningStringStringint() { String[] init1 = { "a", "1", "valid1", "----", "&valid*", "----", @@ -222,6 +264,15 @@ public class SQLWarningTest extends TestCase { /* * Method test for getNextWarning */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "", + targets = { + @TestTarget( + methodName = "getNextWarning", + methodArgs = {} + ) + }) public void testGetNextWarning() { SQLWarning aSQLWarning; @@ -271,6 +322,19 @@ public class SQLWarningTest extends TestCase { /* * Method test for setNextWarning */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "", + targets = { + @TestTarget( + methodName = "setNextWarning", + methodArgs = {SQLWarning.class} + ), + @TestTarget( + methodName = "getNextWarning", + methodArgs = {} + ) + }) public void testSetNextWarningSQLWarning() { SQLWarning[] parm1 = { new SQLWarning(), null }; @@ -318,6 +382,19 @@ public class SQLWarningTest extends TestCase { /** * @tests java.sql.SQLWarning#setNextWarning(java.sql.SQLWarning) */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "", + targets = { + @TestTarget( + methodName = "setNextWarning", + methodArgs = {SQLWarning.class} + ), + @TestTarget( + methodName = "getNextWarning", + methodArgs = {} + ) + }) public void test_setNextWarning_SQLWarning() { SQLWarning sw = new SQLWarning("reason", "SQLState", 0); SQLWarning sw1 = new SQLWarning("reason", "SQLState", 1); @@ -352,6 +429,15 @@ public class SQLWarningTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {} + ) + }) public void testSerializationSelf() throws Exception { SQLWarning object = new SQLWarning(); SerializationTest.verifySelf(object, SQLWARNING_COMPARATOR); @@ -360,6 +446,15 @@ public class SQLWarningTest extends TestCase { /** * @tests serialization/deserialization compatibility with RI. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "SQLWarning", + methodArgs = {String.class, String.class, int.class} + ) + }) public void testSerializationCompatibility() throws Exception { SQLWarning object = new SQLWarning(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java index d0febeb..5aca5e3 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.Statement.class) public class StatementTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java index 299c33a..f82271e 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java @@ -17,12 +17,15 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; + import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import junit.framework.TestCase; +@TestTargetClass(DriverManager.class) /** * Helper class for the Driver manager tes - it allows the test code to be * loaded under a different classloader, necessary for testing the diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java index a523b39..92011ee 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java @@ -17,11 +17,17 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Time; import java.util.TimeZone; import junit.framework.TestCase; +@TestTargetClass(Time.class) /** * JUnit Testcase for the java.sql.Time class * @@ -73,6 +79,15 @@ public class TimeTest extends TestCase { STRING_JP_ARRAY }; @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Deprecated method", + targets = { + @TestTarget( + methodName = "Time", + methodArgs = {int.class, int.class, int.class} + ) + }) public void testTimeintintint() { Time theTime = new Time(10, 45, 20); @@ -80,6 +95,15 @@ public class TimeTest extends TestCase { assertNotNull(theTime); } // end method testTimeintintint() + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Incorrect parameter checking missed", + targets = { + @TestTarget( + methodName = "Time", + methodArgs = {long.class} + ) + }) public void testTime() { Time theTime = new Time(TIME_TEST1); @@ -87,6 +111,15 @@ public class TimeTest extends TestCase { assertNotNull(theTime); } // end method testTime() + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "toString", + methodArgs = {} + ) + }) public void testToString() { // Loop through the timezones testing the String conversion for each for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -95,6 +128,15 @@ public class TimeTest extends TestCase { } // end method test + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "toString", + methodArgs = {} + ) + }) private void testToString(String timeZone, long[] theTimes, String[] theTimeStrings) { // Set the timezone @@ -113,6 +155,15 @@ public class TimeTest extends TestCase { /* * Method test for valueOf */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void testValueOfString() { TimeZone.setDefault(TimeZone.getTimeZone("GMT")); @@ -138,6 +189,15 @@ public class TimeTest extends TestCase { } // end method testValueOfString + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {long.class} + ) + }) public void testSetTime() { // Ensure that the timezone is set to GMT TimeZone.setDefault(TimeZone.getTimeZone("GMT")); @@ -149,6 +209,15 @@ public class TimeTest extends TestCase { assertEquals(STRING_TEST2, theTime.toString()); } // end method testSetTime() + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setDate", + methodArgs = {int.class} + ) + }) @SuppressWarnings("deprecation") public void testSetDate() { Time theTime = new Time(TIME_TEST1); @@ -162,6 +231,15 @@ public class TimeTest extends TestCase { } // end method testSetDate() @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setMonth", + methodArgs = {int.class} + ) + }) public void testSetMonth() { Time theTime = new Time(TIME_TEST1); @@ -174,6 +252,15 @@ public class TimeTest extends TestCase { } // end method testSetMonth() @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setYear", + methodArgs = {int.class} + ) + }) public void testSetYear() { Time theTime = new Time(TIME_TEST1); @@ -186,6 +273,15 @@ public class TimeTest extends TestCase { } // end method testSetYear() @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDate", + methodArgs = {} + ) + }) public void testGetDate() { Time theTime = new Time(TIME_TEST1); @@ -198,6 +294,15 @@ public class TimeTest extends TestCase { } // end method test @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDay", + methodArgs = {} + ) + }) public void testGetDay() { Time theTime = new Time(TIME_TEST1); @@ -210,6 +315,15 @@ public class TimeTest extends TestCase { } // end method test @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getMonth", + methodArgs = {} + ) + }) public void testGetMonth() { Time theTime = new Time(TIME_TEST1); @@ -222,6 +336,15 @@ public class TimeTest extends TestCase { } // end method test @SuppressWarnings("deprecation") + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getYear", + methodArgs = {} + ) + }) public void testGetYear() { Time theTime = new Time(TIME_TEST1); @@ -236,6 +359,15 @@ public class TimeTest extends TestCase { /** * @tests java.sql.Time#valueOf(String ) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void test_valueOf_IllegalArgumentException() { try{ Time.valueOf("15:43:12:34"); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java index 7c5d7ab..8504078 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java @@ -17,6 +17,11 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Timestamp; import java.util.Date; import java.util.TimeZone; @@ -24,6 +29,7 @@ import java.util.TimeZone; import org.apache.harmony.testframework.serialization.SerializationTest; import junit.framework.TestCase; +@TestTargetClass(Timestamp.class) /** * JUnit Testcase for the java.sql.Timestamp class * @@ -109,6 +115,15 @@ public class TimestampTest extends TestCase { /* * Constructor test */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Incorrect parameter checking missed", + targets = { + @TestTarget( + methodName = "Timestamp", + methodArgs = {long.class} + ) + }) public void testTimestamplong() { Timestamp theTimestamp = new Timestamp(TIME_TEST1); @@ -119,6 +134,15 @@ public class TimestampTest extends TestCase { /* * Constructor test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "Timestamp", + methodArgs = {int.class, int.class, int.class, int.class, int.class, int.class, int.class} + ) + }) @SuppressWarnings("deprecation") public void testTimestampintintintintintintint() { int[][] valid = { { 99, 2, 14, 17, 52, 3, 213577212 }, // 0 valid @@ -171,6 +195,15 @@ public class TimestampTest extends TestCase { /* * Method test for setTime */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {long.class} + ) + }) public void testSetTimelong() { // First set the timezone to GMT TimeZone.setDefault(TimeZone.getTimeZone("GMT")); @@ -189,6 +222,15 @@ public class TimestampTest extends TestCase { /* * Method test for getTime */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getTime", + methodArgs = {} + ) + }) public void testGetTime() { // First set the timezone to GMT TimeZone.setDefault(TimeZone.getTimeZone("GMT")); @@ -203,6 +245,15 @@ public class TimestampTest extends TestCase { /* * Method test for getYear */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getYear", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetYear() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -215,6 +266,15 @@ public class TimestampTest extends TestCase { /* * Method test for getMonth */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getMonth", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetMonth() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -227,6 +287,15 @@ public class TimestampTest extends TestCase { /* * Method test for getDate */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getDate", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetDate() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -239,6 +308,15 @@ public class TimestampTest extends TestCase { /* * Method test for getHours */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getHours", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetHours() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -251,6 +329,15 @@ public class TimestampTest extends TestCase { /* * Method test for getMinutes */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getMinutes", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetMinutes() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -263,6 +350,15 @@ public class TimestampTest extends TestCase { /* * Method test for getSeconds */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Deprecation", + targets = { + @TestTarget( + methodName = "getSeconds", + methodArgs = {} + ) + }) @SuppressWarnings("deprecation") public void testGetSeconds() { for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -277,6 +373,15 @@ public class TimestampTest extends TestCase { */ static String theExceptionMessage = "Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff"; + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void testValueOfString() { for (int i = 0; i < TIME_ARRAY.length; i++) { Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]); @@ -308,6 +413,15 @@ public class TimestampTest extends TestCase { /* * Method test for valueOf */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {String.class} + ) + }) public void testValueOfString1() { Timestamp theReturn; @@ -353,6 +467,15 @@ public class TimestampTest extends TestCase { /* * Method test for toString */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "toString", + methodArgs = {} + ) + }) public void testToString() { for (int i = 0; i < TIME_ARRAY.length; i++) { Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]); @@ -364,6 +487,15 @@ public class TimestampTest extends TestCase { /* * Method test for getNanos */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getNanos", + methodArgs = {} + ) + }) public void testGetNanos() { for (int i = 0; i < TIME_ARRAY.length; i++) { Timestamp theTimestamp = new Timestamp(TIME_ARRAY[i]); @@ -375,6 +507,15 @@ public class TimestampTest extends TestCase { /* * Method test for setNanos */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setNanos", + methodArgs = {int.class} + ) + }) public void testSetNanosint() { int[] NANOS_INVALID = { -137891990, 1635665198, -1 }; for (int i = 0; i < TIME_ARRAY.length; i++) { @@ -407,6 +548,15 @@ public class TimestampTest extends TestCase { /* * Method test for equals */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "equals", + methodArgs = {Timestamp.class} + ) + }) public void testEqualsTimestamp() { for (long element : TIME_ARRAY) { Timestamp theTimestamp = new Timestamp(element); @@ -429,6 +579,15 @@ public class TimestampTest extends TestCase { /* * Method test for equals */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "equals", + methodArgs = {Object.class} + ) + }) public void testEqualsObject() { for (long element : TIME_ARRAY) { Timestamp theTimestamp = new Timestamp(element); @@ -457,6 +616,15 @@ public class TimestampTest extends TestCase { /* * Method test for before */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "before", + methodArgs = {Timestamp.class} + ) + }) public void testBeforeTimestamp() { Timestamp theTest = new Timestamp(TIME_LATE); @@ -488,6 +656,15 @@ public class TimestampTest extends TestCase { /* * Method test for after */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "after", + methodArgs = {Timestamp.class} + ) + }) public void testAfterTimestamp() { Timestamp theTest = new Timestamp(TIME_LATE); @@ -519,6 +696,15 @@ public class TimestampTest extends TestCase { /* * Method test for compareTo */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "compareTo", + methodArgs = {Timestamp.class} + ) + }) @SuppressWarnings("deprecation") public void testCompareToTimestamp() { Timestamp theTest = new Timestamp(TIME_EARLY); @@ -556,6 +742,15 @@ public class TimestampTest extends TestCase { /** * @tests java.sql.Timestamp#compareTo(java.util.Date) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "compareTo", + methodArgs = {Date.class} + ) + }) public void testCompareToDate() { Date theTest = new Timestamp(TIME_EARLY); Date theTest2 = new Timestamp(TIME_LATE); @@ -590,6 +785,15 @@ public class TimestampTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationSelf", + methodArgs = {} + ) + }) public void testSerializationSelf() throws Exception { Timestamp object = new Timestamp(100L); SerializationTest.verifySelf(object); @@ -598,6 +802,15 @@ public class TimestampTest extends TestCase { /** * @tests serialization/deserialization compatibility with RI. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Serialization test", + targets = { + @TestTarget( + methodName = "!SerializationGolden", + methodArgs = {} + ) + }) public void testSerializationCompatibility() throws Exception { Timestamp object = new Timestamp(100L); SerializationTest.verifyGolden(this, object); @@ -606,6 +819,15 @@ public class TimestampTest extends TestCase { /** * @tests java.sql.Timestamp#toString() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "toString", + methodArgs = {} + ) + }) public void test_toString() { Timestamp t1 = new Timestamp(Long.MIN_VALUE); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java index 5ee8860..49b583a 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.sql.tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import junit.framework.TestCase; +@TestTargetClass(java.sql.Types.class) public class TypesTest extends TestCase { /* * Public statics test */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "Field testing", + targets = { + @TestTarget( + methodName = "!Constants", + methodArgs = {} + ) + }) public void testPublicStatics() { HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>(); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java index a5d7617..34d895c 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/ConnectionEventTest.java @@ -17,12 +17,31 @@ package org.apache.harmony.sql.tests.javax.sql; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + import java.sql.SQLException; import javax.sql.ConnectionEvent; +import javax.sql.PooledConnection; +import javax.sql.RowSet; + import junit.framework.TestCase; +@TestTargetClass(ConnectionEvent.class) public class ConnectionEventTest extends TestCase { + /** + * @tests {@link javax.sql.RowSetEvent#RowSetEvent(javax.sql.RowSet)}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies RowSetEvent() constructor.", + targets = { @TestTarget(methodName = "RowSetEvent", + methodArgs = {RowSet.class}) + } + ) public void testConstructorConnection() { try { new ConnectionEvent(null); @@ -36,6 +55,16 @@ public class ConnectionEventTest extends TestCase { assertNull(ce.getSQLException()); } + /** + * @tests {@link javax.sql.ConnectionEvent#ConnectionEvent(PooledConnection, SQLException)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies ConnectionEvent() constructor for the abnormal case that an error has occurred on the pooled connection.", + targets = { @TestTarget(methodName = "testConnectionEventPooledConnection", + methodArgs = {PooledConnection.class,SQLException.class}) + } + ) public void testConstructorConnectionSQLException() { try { new ConnectionEvent(null, null); diff --git a/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java b/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java index e78280b..0ec9084 100644 --- a/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java +++ b/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/RowSetEventTest.java @@ -17,11 +17,28 @@ package org.apache.harmony.sql.tests.javax.sql; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import javax.sql.RowSet; import javax.sql.RowSetEvent; import junit.framework.TestCase; +@TestTargetClass(RowSetEvent.class) public class RowSetEventTest extends TestCase { + /** + * @tests {@link javax.sql.RowSetEvent#RowSetEvent(javax.sql.RowSet)}. + */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies RowSetEvent() constructor.", + targets = { @TestTarget(methodName = "RowSetEvent", + methodArgs = {RowSet.class}) + } + ) public void testConstructor() { try { new RowSetEvent(null); diff --git a/sql/src/test/java/tests/java/sql/DatabaseMetaDataTest.java b/sql/src/test/java/tests/java/sql/DatabaseMetaDataTest.java index 42ae249..bd72e4e 100755 --- a/sql/src/test/java/tests/java/sql/DatabaseMetaDataTest.java +++ b/sql/src/test/java/tests/java/sql/DatabaseMetaDataTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -24,7 +29,6 @@ import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; import java.util.Arrays; -import java.util.HashSet; import tests.support.DatabaseCreator; import tests.support.Support_SQL; @@ -34,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(DatabaseMetaData.class) public class DatabaseMetaDataTest extends TestCase { private static String VIEW_NAME = "myView"; @@ -116,6 +121,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#allProceduresAreCallable() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "allProceduresAreCallable", + methodArgs = {} + ) + }) public void test_allProceduresAreCallable() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -168,6 +182,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "dataDefinitionCausesTransactionCommit", + methodArgs = {} + ) + }) public void test_dataDefinitionCausesTransactionCommit() throws SQLException { // TODO: JDBC does not implement this functionality @@ -176,6 +199,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#dataDefinitionIgnoredInTransactions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "dataDefinitionIgnoredInTransactions", + methodArgs = {} + ) + }) public void test_dataDefinitionIgnoredInTransactions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -183,6 +215,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#deletesAreDetected(int) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "deletesAreDetected", + methodArgs = {int.class} + ) + }) public void test_deletesAreDetectedI() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -190,6 +231,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#doesMaxRowSizeIncludeBlobs() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "doesMaxRowSizeIncludeBlobs", + methodArgs = {} + ) + }) public void test_doesMaxRowSizeIncludeBlobs() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -198,6 +248,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getAttributes(java.lang.String, * java.lang.String, java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getAttributes", + methodArgs = {String.class, String.class, String.class, String.class} + ) + }) public void test_getAttributesLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { // TODO: JDBC does not implement this functionality @@ -207,6 +266,16 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getBestRowIdentifier(java.lang.String, * java.lang.String, java.lang.String, int, boolean) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "All variants of parameters were not tested. " + + "SQLException checking missed.", + targets = { + @TestTarget( + methodName = "getBestRowIdentifier", + methodArgs = {String.class, String.class, String.class, int.class, boolean.class} + ) + }) public void test_getBestRowIdentifierLjava_lang_StringLjava_lang_StringLjava_lang_StringIZ() throws SQLException { ResultSet result = statementForward.executeQuery("SELECT * FROM " @@ -250,6 +319,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getCatalogSeparator() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getCatalogSeparator", + methodArgs = {} + ) + }) public void test_getCatalogSeparator() throws SQLException { assertTrue("Incorrect catalog separator", "".equals(meta .getCatalogSeparator().trim())); @@ -258,6 +336,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getCatalogTerm() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getCatalogTerm", + methodArgs = {} + ) + }) public void test_getCatalogTerm() throws SQLException { assertTrue("Incorrect catalog term", "".equals(meta .getCatalogSeparator().trim())); @@ -266,6 +353,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getCatalogs() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Received result wasn't checked.", + targets = { + @TestTarget( + methodName = "getCatalogs", + methodArgs = {} + ) + }) public void test_getCatalogs() throws SQLException { ResultSet rs = meta.getCatalogs(); // TODO getCatalog is not supported @@ -334,6 +431,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getConnection() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {} + ) + }) public void test_getConnection() throws SQLException { assertEquals("Incorrect connection value", conn, meta.getConnection()); } @@ -343,6 +449,16 @@ public class DatabaseMetaDataTest extends TestCase { * java.lang.String, java.lang.String, java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "All variants of parameters were not tested.", + targets = { + @TestTarget( + methodName = "getCrossReference", + methodArgs = {String.class, String.class, String.class, String.class, String.class, String.class} + ) + }) public void test_getCrossReferenceLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { ResultSet rs = meta.getCrossReference(conn.getCatalog(), null, @@ -398,6 +514,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDatabaseMajorVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDatabaseMajorVersion", + methodArgs = {} + ) + }) public void test_getDatabaseMajorVersion() throws SQLException { assertTrue("Incorrdct database major version", meta .getDatabaseMajorVersion() >= 0); @@ -406,6 +531,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDatabaseMinorVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDatabaseMinorVersion", + methodArgs = {} + ) + }) public void test_getDatabaseMinorVersion() throws SQLException { assertTrue("Incorrect database minor version", meta .getDatabaseMinorVersion() >= 0); @@ -414,6 +548,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDatabaseProductName() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDatabaseProductName", + methodArgs = {} + ) + }) public void test_getDatabaseProductName() throws SQLException { assertTrue("Incorrect database product name", !"".equals(meta .getDatabaseProductName().trim())); @@ -422,6 +565,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDatabaseProductVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDatabaseProductVersion", + methodArgs = {} + ) + }) public void test_getDatabaseProductVersion() throws SQLException { assertTrue("Incorrect database product version", !"".equals(meta .getDatabaseProductVersion().trim())); @@ -430,6 +582,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDefaultTransactionIsolation() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDefaultTransactionIsolation", + methodArgs = {} + ) + }) public void test_getDefaultTransactionIsolation() throws SQLException { int defaultLevel = meta.getDefaultTransactionIsolation(); switch (defaultLevel) { @@ -448,6 +609,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDriverMajorVersion() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDriverMajorVersion", + methodArgs = {} + ) + }) public void test_getDriverMajorVersion() { assertTrue("Incorrect driver major version", meta .getDriverMajorVersion() >= 0); @@ -456,6 +626,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDriverMinorVersion() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "getDriverMinorVersion", + methodArgs = {} + ) + }) public void test_getDriverMinorVersion() { assertTrue("Incorrect driver minor version", meta .getDriverMinorVersion() >= 0); @@ -464,6 +643,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDriverName() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDriverName", + methodArgs = {} + ) + }) public void test_getDriverName() throws SQLException { assertTrue("Incorrect driver name", !"".equals(meta.getDriverName() .trim())); @@ -472,6 +660,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getDriverVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getDriverVersion", + methodArgs = {} + ) + }) public void test_getDriverVersion() throws SQLException { assertTrue("Incorrect driver version", !"".equals(meta .getDriverVersion().trim())); @@ -537,6 +734,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getExtraNameCharacters() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getExtraNameCharacters", + methodArgs = {} + ) + }) public void test_getExtraNameCharacters() throws SQLException { assertNotNull("Incorrect extra name characters", meta .getExtraNameCharacters()); @@ -545,6 +751,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getIdentifierQuoteString() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getIdentifierQuoteString", + methodArgs = {} + ) + }) public void test_getIdentifierQuoteString() throws SQLException { assertTrue("Incorrect identifier of quoted string", !"".equals(meta .getIdentifierQuoteString().trim())); @@ -554,6 +769,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getImportedKeys(java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getImportedKeys", + methodArgs = {String.class, String.class, String.class} + ) + }) public void test_getImportedKeysLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { ResultSet rs = meta.getImportedKeys(conn.getCatalog(), null, @@ -658,6 +882,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getJDBCMajorVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getJDBCMajorVersion", + methodArgs = {} + ) + }) public void test_getJDBCMajorVersion() throws SQLException { assertTrue("Incorrect JDBC major version", meta.getJDBCMajorVersion() >= 0); @@ -666,6 +899,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getJDBCMinorVersion() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getJDBCMinorVersion", + methodArgs = {} + ) + }) public void test_getJDBCMinorVersion() throws SQLException { assertTrue("Incorrect JDBC minor version", meta.getJDBCMinorVersion() >= 0); @@ -674,6 +916,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxBinaryLiteralLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxBinaryLiteralLength", + methodArgs = {} + ) + }) public void test_getMaxBinaryLiteralLength() throws SQLException { assertTrue("Incorrect binary literal length", meta .getMaxBinaryLiteralLength() >= 0); @@ -682,6 +933,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxCatalogNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxCatalogNameLength", + methodArgs = {} + ) + }) public void test_getMaxCatalogNameLength() throws SQLException { assertTrue("Incorrect name length", meta.getMaxCatalogNameLength() >= 0); } @@ -689,6 +949,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxCharLiteralLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxCharLiteralLength", + methodArgs = {} + ) + }) public void test_getMaxCharLiteralLength() throws SQLException { assertTrue("Incorrect char literal length", meta .getMaxCharLiteralLength() >= 0); @@ -697,6 +966,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnNameLength", + methodArgs = {} + ) + }) public void test_getMaxColumnNameLength() throws SQLException { assertTrue("Incorrect column name length", meta .getMaxColumnNameLength() >= 0); @@ -705,6 +983,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnsInGroupBy() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnsInGroupBy", + methodArgs = {} + ) + }) public void test_getMaxColumnsInGroupBy() throws SQLException { assertTrue("Incorrect number of columns", meta.getMaxColumnsInGroupBy() >= 0); @@ -713,6 +1000,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnsInIndex() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnsInIndex", + methodArgs = {} + ) + }) public void test_getMaxColumnsInIndex() throws SQLException { assertTrue("Incorrect number of columns", meta.getMaxColumnsInIndex() >= 0); @@ -721,6 +1017,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnsInOrderBy() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnsInOrderBy", + methodArgs = {} + ) + }) public void test_getMaxColumnsInOrderBy() throws SQLException { assertTrue("Incorrect number of columns", meta.getMaxColumnsInOrderBy() >= 0); @@ -729,6 +1034,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnsInSelect() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnsInSelect", + methodArgs = {} + ) + }) public void test_getMaxColumnsInSelect() throws SQLException { assertTrue("Incorrect number of columns", meta.getMaxColumnsInSelect() >= 0); @@ -737,6 +1051,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxColumnsInTable() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxColumnsInTable", + methodArgs = {} + ) + }) public void test_getMaxColumnsInTable() throws SQLException { assertTrue("Incorrect number of columns", meta.getMaxColumnsInTable() >= 0); @@ -745,6 +1068,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxConnections() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxConnections", + methodArgs = {} + ) + }) public void test_getMaxConnections() throws SQLException { assertTrue("Incorrect number of connections", meta.getMaxConnections() >= 0); @@ -753,6 +1085,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxCursorNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxCursorNameLength", + methodArgs = {} + ) + }) public void test_getMaxCursorNameLength() throws SQLException { int nameLength = meta.getMaxCursorNameLength(); if (nameLength > 0) { @@ -770,6 +1111,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxIndexLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxIndexLength", + methodArgs = {} + ) + }) public void test_getMaxIndexLength() throws SQLException { assertTrue("Incorrect length of index", meta.getMaxIndexLength() >= 0); } @@ -777,6 +1127,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxProcedureNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxProcedureNameLength", + methodArgs = {} + ) + }) public void test_getMaxProcedureNameLength() throws SQLException { assertTrue("Incorrect length of procedure name", meta .getMaxProcedureNameLength() >= 0); @@ -785,6 +1144,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxRowSize() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxRowSize", + methodArgs = {} + ) + }) public void test_getMaxRowSize() throws SQLException { assertTrue("Incorrect size of row", meta.getMaxRowSize() >= 0); } @@ -792,6 +1160,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxSchemaNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxSchemaNameLength", + methodArgs = {} + ) + }) public void test_getMaxSchemaNameLength() throws SQLException { assertTrue("Incorrect length of schema name", meta .getMaxSchemaNameLength() >= 0); @@ -800,6 +1177,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxStatementLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxStatementLength", + methodArgs = {} + ) + }) public void test_getMaxStatementLength() throws SQLException { assertTrue("Incorrect length of statement", meta .getMaxStatementLength() >= 0); @@ -808,6 +1194,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxStatements() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxStatements", + methodArgs = {} + ) + }) public void test_getMaxStatements() throws SQLException { assertTrue("Incorrect number of statements", meta.getMaxStatements() >= 0); @@ -816,6 +1211,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxTableNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxTableNameLength", + methodArgs = {} + ) + }) public void test_getMaxTableNameLength() throws SQLException { assertTrue("Incorrect length of table name", meta .getMaxTableNameLength() >= 0); @@ -824,6 +1228,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxTablesInSelect() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxTablesInSelect", + methodArgs = {} + ) + }) public void test_getMaxTablesInSelect() throws SQLException { assertTrue("Incorrect number of tables", meta.getMaxTablesInSelect() >= 0); @@ -832,6 +1245,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getMaxUserNameLength() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMaxUserNameLength", + methodArgs = {} + ) + }) public void test_getMaxUserNameLength() throws SQLException { assertTrue("Incorrect length of user name", meta.getMaxUserNameLength() >= 0); @@ -840,6 +1262,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getNumericFunctions() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getNumericFunctions", + methodArgs = {} + ) + }) public void test_getNumericFunctions() throws SQLException { assertTrue("Incorrect list of math functions", "".equals(meta .getNumericFunctions().trim())); @@ -849,6 +1280,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getPrimaryKeys(java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getPrimaryKeys", + methodArgs = {String.class, String.class, String.class} + ) + }) public void test_getPrimaryKeysLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { ResultSet rs = meta.getPrimaryKeys(conn.getCatalog(), null, @@ -881,6 +1321,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getProcedureColumns(java.lang.String, * java.lang.String, java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getProcedureColumns", + methodArgs = {String.class, String.class, String.class, String.class} + ) + }) public void test_getProcedureColumnsLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { // TODO: JDBC does not implement this functionality @@ -889,6 +1338,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getProcedureTerm() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getProcedureTerm", + methodArgs = {} + ) + }) public void test_getProcedureTerm() throws SQLException { assertTrue("Incorrect procedure term", "".equals(meta .getProcedureTerm().trim())); @@ -898,6 +1356,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getProcedures(java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getProcedures", + methodArgs = {String.class, String.class, String.class} + ) + }) public void test_getProceduresLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { // TODO: JDBC does not implement this functionality @@ -906,6 +1373,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getResultSetHoldability() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getResultSetHoldability", + methodArgs = {} + ) + }) public void test_getResultSetHoldability() throws SQLException { int hdb = meta.getResultSetHoldability(); switch (hdb) { @@ -923,6 +1399,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSQLKeywords() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSQLKeywords", + methodArgs = {} + ) + }) public void test_getSQLKeywords() throws SQLException { assertTrue("Incorrect SQL keywords", !"".equals(meta.getSQLKeywords() .trim())); @@ -931,6 +1416,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSQLStateType() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSQLStateType", + methodArgs = {} + ) + }) public void test_getSQLStateType() throws SQLException { int type = meta.getSQLStateType(); switch (type) { @@ -946,6 +1440,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSchemaTerm() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSchemaTerm", + methodArgs = {} + ) + }) public void test_getSchemaTerm() throws SQLException { assertNotNull("Incorrect schema term", meta.getSchemaTerm()); } @@ -953,6 +1456,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSchemas() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSchemas", + methodArgs = {} + ) + }) public void test_getSchemas() throws SQLException { ResultSet rs = meta.getSchemas(); ResultSetMetaData rsmd = rs.getMetaData(); @@ -970,6 +1482,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSearchStringEscape() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSearchStringEscape", + methodArgs = {} + ) + }) public void test_getSearchStringEscape() throws SQLException { assertTrue("Incorrect search string escape", !"".equals(meta .getSearchStringEscape().trim())); @@ -978,6 +1499,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getStringFunctions() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getStringFunctions", + methodArgs = {} + ) + }) public void test_getStringFunctions() throws SQLException { assertTrue("Incorrect string functions", "".equals(meta .getStringFunctions().trim())); @@ -987,6 +1517,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getSuperTables(java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getSuperTables", + methodArgs = {String.class, String.class, String.class} + ) + }) public void test_getSuperTablesLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { // TODO: JDBC does not implement this functionality @@ -996,6 +1535,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getSuperTypes(java.lang.String, * java.lang.String, java.lang.String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getSuperTypes", + methodArgs = {String.class, String.class, String.class} + ) + }) public void test_getSuperTypesLjava_lang_StringLjava_lang_StringLjava_lang_String() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1004,6 +1552,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getSystemFunctions() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getSystemFunctions", + methodArgs = {} + ) + }) public void test_getSystemFunctions() throws SQLException { assertTrue("No system function exist", meta.getSystemFunctions() .trim().equals("")); @@ -1113,6 +1670,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getTableTypes() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getTableTypes", + methodArgs = {} + ) + }) public void test_getTableTypes() throws SQLException { String[] tableTypes = { "LOCAL TEMPORARY", "TABLE", "VIEW" }; ResultSet rs = meta.getTableTypes(); @@ -1128,6 +1694,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getTables(java.lang.String, * java.lang.String, java.lang.String, java.lang.String[]) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getTables", + methodArgs = {String.class, String.class, String.class, String[].class} + ) + }) public void test_getTablesLjava_lang_StringLjava_lang_StringLjava_lang_String$Ljava_lang_String() throws SQLException { String[] tablesName = { VIEW_NAME, DatabaseCreator.TEST_TABLE1, @@ -1187,6 +1762,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getTimeDateFunctions() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getTimeDateFunctions", + methodArgs = {} + ) + }) public void test_getTimeDateFunctions() throws SQLException { assertFalse("No time and data functions exist", !meta .getTimeDateFunctions().trim().equals("")); @@ -1195,6 +1779,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getTypeInfo() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getTypeInfo", + methodArgs = {} + ) + }) public void test_getTypeInfo() throws SQLException { insertNewRecord(); @@ -1234,6 +1827,15 @@ public class DatabaseMetaDataTest extends TestCase { * @tests java.sql.DatabaseMetaData #getUDTs(java.lang.String, * java.lang.String, java.lang.String, int[]) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "getUDTs", + methodArgs = {String.class, String.class, String.class, int[].class} + ) + }) public void test_getUDTsLjava_lang_StringLjava_lang_StringLjava_lang_String$I() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1242,6 +1844,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#getURL() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getURL", + methodArgs = {} + ) + }) public void test_getURL() throws SQLException { assertEquals("Wrong url", Support_SQL.sqlUrl, meta.getURL()); } @@ -1286,6 +1897,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#insertsAreDetected(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "insertsAreDetected", + methodArgs = {int.class} + ) + }) public void test_insertsAreDetectedI() throws SQLException { assertFalse( "visible row insert can be detected for TYPE_FORWARD_ONLY type", @@ -1301,6 +1922,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#isCatalogAtStart() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "isCatalogAtStart", + methodArgs = {} + ) + }) public void test_isCatalogAtStart() throws SQLException { assertFalse( "catalog doesn't appear at the start of a fully qualified table name", @@ -1310,6 +1940,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#isReadOnly() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "isReadOnly", + methodArgs = {} + ) + }) public void test_isReadOnly() throws SQLException { assertFalse("database is not read-only", meta.isReadOnly()); } @@ -1317,6 +1956,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#locatorsUpdateCopy() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "locatorsUpdateCopy", + methodArgs = {} + ) + }) public void test_locatorsUpdateCopy() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1324,6 +1972,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#nullPlusNonNullIsNull() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "nullPlusNonNullIsNull", + methodArgs = {} + ) + }) public void test_nullPlusNonNullIsNull() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1331,6 +1988,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#nullsAreSortedAtEnd() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "nullsAreSortedAtEnd", + methodArgs = {} + ) + }) public void test_nullsAreSortedAtEnd() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1338,6 +2004,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#nullsAreSortedAtStart() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "nullsAreSortedAtStart", + methodArgs = {} + ) + }) public void test_nullsAreSortedAtStart() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1345,6 +2020,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#nullsAreSortedHigh() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "nullsAreSortedHigh", + methodArgs = {} + ) + }) public void test_nullsAreSortedHigh() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1352,6 +2036,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#nullsAreSortedLow() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "nullsAreSortedLow", + methodArgs = {} + ) + }) public void test_nullsAreSortedLow() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1359,6 +2052,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#othersDeletesAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "othersDeletesAreVisible", + methodArgs = {int.class} + ) + }) public void test_othersDeletesAreVisibleI() throws SQLException { assertFalse( "deletes made by others are visible for TYPE_FORWARD_ONLY type", @@ -1376,6 +2079,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#othersInsertsAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "othersInsertsAreVisible", + methodArgs = {int.class} + ) + }) public void test_othersInsertsAreVisibleI() throws SQLException { assertFalse( "inserts made by others are visible for TYPE_FORWARD_ONLY type", @@ -1393,6 +2106,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#othersUpdatesAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "othersUpdatesAreVisible", + methodArgs = {int.class} + ) + }) public void test_othersUpdatesAreVisibleI() throws SQLException { assertFalse( "updates made by others are visible for TYPE_FORWARD_ONLY type", @@ -1410,6 +2133,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#ownDeletesAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "ownDeletesAreVisible", + methodArgs = {int.class} + ) + }) public void test_ownDeletesAreVisibleI() throws SQLException { // TODO not supported // assertFalse( @@ -1428,6 +2161,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#ownInsertsAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "ownInsertsAreVisible", + methodArgs = {int.class} + ) + }) public void test_ownInsertsAreVisibleI() throws SQLException { // assertFalse( // "result set's own inserts are visible for TYPE_FORWARD_ONLY type", @@ -1445,6 +2188,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#ownUpdatesAreVisible(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "ownUpdatesAreVisible", + methodArgs = {int.class} + ) + }) public void test_ownUpdatesAreVisibleI() throws SQLException { // TODO not supported // assertFalse( @@ -1463,6 +2216,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesLowerCaseIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "storesLowerCaseIdentifiers", + methodArgs = {} + ) + }) public void test_storesLowerCaseIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1470,6 +2232,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesLowerCaseQuotedIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "storesLowerCaseQuotedIdentifiers", + methodArgs = {} + ) + }) public void test_storesLowerCaseQuotedIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1477,6 +2248,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesMixedCaseIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Method storesMixedCaseQuotedIdentifiers was invoked instead of storesMixedCaseIdentifiers", + targets = { + @TestTarget( + methodName = "storesMixedCaseIdentifiers", + methodArgs = {} + ) + }) public void test_storesMixedCaseIdentifiers() throws SQLException { insertNewRecord(); @@ -1498,6 +2278,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesMixedCaseQuotedIdentifiers() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "storesMixedCaseQuotedIdentifiers", + methodArgs = {} + ) + }) public void test_storesMixedCaseQuotedIdentifiers() throws SQLException { String quote = meta.getIdentifierQuoteString(); @@ -1521,6 +2310,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesUpperCaseIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "storesUpperCaseIdentifiers", + methodArgs = {} + ) + }) public void test_storesUpperCaseIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1528,6 +2326,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#storesUpperCaseQuotedIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "storesUpperCaseQuotedIdentifiers", + methodArgs = {} + ) + }) public void test_storesUpperCaseQuotedIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1535,6 +2342,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsANSI92EntryLevelSQL() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsANSI92EntryLevelSQL", + methodArgs = {} + ) + }) public void test_supportsANSI92EntryLevelSQL() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1542,6 +2358,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsANSI92FullSQL() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsANSI92FullSQL", + methodArgs = {} + ) + }) public void test_supportsANSI92FullSQL() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1549,6 +2374,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsANSI92IntermediateSQL() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsANSI92IntermediateSQL", + methodArgs = {} + ) + }) public void test_supportsANSI92IntermediateSQL() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1556,6 +2390,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsAlterTableWithAddColumn() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsAlterTableWithAddColumn", + methodArgs = {} + ) + }) public void test_supportsAlterTableWithAddColumn() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1563,6 +2406,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsAlterTableWithDropColumn() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsAlterTableWithDropColumn", + methodArgs = {} + ) + }) public void test_supportsAlterTableWithDropColumn() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1570,6 +2422,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsBatchUpdates() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsBatchUpdates", + methodArgs = {} + ) + }) public void test_supportsBatchUpdates() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1577,6 +2438,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCatalogsInDataManipulation() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCatalogsInDataManipulation", + methodArgs = {} + ) + }) public void test_supportsCatalogsInDataManipulation() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1584,6 +2454,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCatalogsInIndexDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCatalogsInIndexDefinitions", + methodArgs = {} + ) + }) public void test_supportsCatalogsInIndexDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1591,6 +2470,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCatalogsInPrivilegeDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCatalogsInPrivilegeDefinitions", + methodArgs = {} + ) + }) public void test_supportsCatalogsInPrivilegeDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1599,6 +2487,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCatalogsInProcedureCalls() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCatalogsInProcedureCalls", + methodArgs = {} + ) + }) public void test_supportsCatalogsInProcedureCalls() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1606,6 +2503,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCatalogsInTableDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCatalogsInTableDefinitions", + methodArgs = {} + ) + }) public void test_supportsCatalogsInTableDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1613,6 +2519,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsColumnAliasing() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsColumnAliasing", + methodArgs = {} + ) + }) public void test_supportsColumnAliasing() throws SQLException { insertNewRecord(); @@ -1637,6 +2552,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsConvert() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsConvert", + methodArgs = {} + ) + }) public void test_supportsConvert() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1644,6 +2568,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsConvert(int, int) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsConvert", + methodArgs = {int.class, int.class} + ) + }) public void test_supportsConvertII() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1651,6 +2584,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCoreSQLGrammar() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCoreSQLGrammar", + methodArgs = {} + ) + }) public void test_supportsCoreSQLGrammar() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1658,6 +2600,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsCorrelatedSubqueries() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsCorrelatedSubqueries", + methodArgs = {} + ) + }) public void test_supportsCorrelatedSubqueries() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1665,6 +2616,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsDataDefinitionAndDataManipulationTransactions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsDataDefinitionAndDataManipulationTransactions", + methodArgs = {} + ) + }) public void test_supportsDataDefinitionAndDataManipulationTransactions() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1673,6 +2633,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsDataManipulationTransactionsOnly() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsDataManipulationTransactionsOnly", + methodArgs = {} + ) + }) public void test_supportsDataManipulationTransactionsOnly() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1681,6 +2650,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsDifferentTableCorrelationNames() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsDifferentTableCorrelationNames", + methodArgs = {} + ) + }) public void test_supportsDifferentTableCorrelationNames() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1689,6 +2667,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsExpressionsInOrderBy() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsExpressionsInOrderBy", + methodArgs = {} + ) + }) public void test_supportsExpressionsInOrderBy() throws SQLException { insertNewRecord(); @@ -1710,6 +2697,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsExtendedSQLGrammar() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsExtendedSQLGrammar", + methodArgs = {} + ) + }) public void test_supportsExtendedSQLGrammar() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1717,6 +2713,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsFullOuterJoins() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsFullOuterJoins", + methodArgs = {} + ) + }) public void test_supportsFullOuterJoins() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1724,6 +2729,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsGetGeneratedKeys() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsGetGeneratedKeys", + methodArgs = {} + ) + }) public void test_supportsGetGeneratedKeys() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1731,6 +2745,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsGroupBy() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsGroupBy", + methodArgs = {} + ) + }) public void test_supportsGroupBy() throws SQLException { insertNewRecord(); @@ -1752,6 +2775,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsGroupByBeyondSelect() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsGroupByBeyondSelect", + methodArgs = {} + ) + }) public void test_supportsGroupByBeyondSelect() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1759,6 +2791,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsGroupByUnrelated() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsGroupByUnrelated", + methodArgs = {} + ) + }) public void test_supportsGroupByUnrelated() throws SQLException { insertNewRecord(); @@ -1780,6 +2821,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsIntegrityEnhancementFacility() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsIntegrityEnhancementFacility", + methodArgs = {} + ) + }) public void test_supportsIntegrityEnhancementFacility() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1787,6 +2837,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsLikeEscapeClause() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsLikeEscapeClause", + methodArgs = {} + ) + }) public void test_supportsLikeEscapeClause() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1794,6 +2853,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsLimitedOuterJoins() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsLimitedOuterJoins", + methodArgs = {} + ) + }) public void test_supportsLimitedOuterJoins() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1801,6 +2869,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMinimumSQLGrammar() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMinimumSQLGrammar", + methodArgs = {} + ) + }) public void test_supportsMinimumSQLGrammar() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1808,6 +2885,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMixedCaseIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMixedCaseIdentifiers", + methodArgs = {} + ) + }) public void test_supportsMixedCaseIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1815,6 +2901,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMixedCaseQuotedIdentifiers() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMixedCaseQuotedIdentifiers", + methodArgs = {} + ) + }) public void test_supportsMixedCaseQuotedIdentifiers() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1822,6 +2917,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMultipleOpenResults() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMultipleOpenResults", + methodArgs = {} + ) + }) public void test_supportsMultipleOpenResults() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1829,6 +2933,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMultipleResultSets() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMultipleResultSets", + methodArgs = {} + ) + }) public void test_supportsMultipleResultSets() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1836,6 +2949,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsMultipleTransactions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsMultipleTransactions", + methodArgs = {} + ) + }) public void test_supportsMultipleTransactions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1843,6 +2965,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsNamedParameters() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsNamedParameters", + methodArgs = {} + ) + }) public void test_supportsNamedParameters() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1850,6 +2981,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsNonNullableColumns() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsNonNullableColumns", + methodArgs = {} + ) + }) public void test_supportsNonNullableColumns() throws SQLException { assertTrue( "columns in this database may not be defined as non-nullable", @@ -1859,6 +2999,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOpenCursorsAcrossCommit() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsOpenCursorsAcrossCommit", + methodArgs = {} + ) + }) public void test_supportsOpenCursorsAcrossCommit() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1866,6 +3015,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOpenCursorsAcrossRollback() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsOpenCursorsAcrossRollback", + methodArgs = {} + ) + }) public void test_supportsOpenCursorsAcrossRollback() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1873,6 +3031,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOpenStatementsAcrossCommit() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsOpenStatementsAcrossCommit", + methodArgs = {} + ) + }) public void test_supportsOpenStatementsAcrossCommit() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1880,6 +3047,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOpenStatementsAcrossRollback() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsOpenStatementsAcrossRollback", + methodArgs = {} + ) + }) public void test_supportsOpenStatementsAcrossRollback() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1887,6 +3063,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOrderByUnrelated() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsOrderByUnrelated", + methodArgs = {} + ) + }) public void test_supportsOrderByUnrelated() throws SQLException { insertNewRecord(); @@ -1908,6 +3093,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsOuterJoins() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsOuterJoins", + methodArgs = {} + ) + }) public void test_supportsOuterJoins() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1915,6 +3109,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsPositionedDelete() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsPositionedDelete", + methodArgs = {} + ) + }) public void test_supportsPositionedDelete() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1922,6 +3125,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsPositionedUpdate() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsPositionedUpdate", + methodArgs = {} + ) + }) public void test_supportsPositionedUpdate() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1929,6 +3141,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsResultSetConcurrency(int, int) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsResultSetConcurrency", + methodArgs = {int.class, int.class} + ) + }) public void test_supportsResultSetConcurrencyII() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1936,6 +3157,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsResultSetHoldability(int) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsResultSetHoldability", + methodArgs = {int.class} + ) + }) public void test_supportsResultSetHoldabilityI() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1943,6 +3173,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsResultSetType(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "supportsResultSetType", + methodArgs = {int.class} + ) + }) public void test_supportsResultSetTypeI() throws SQLException { // TODO not supported // assertFalse("database supports TYPE_FORWARD_ONLY type", meta @@ -1958,6 +3198,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSavepoints() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSavepoints", + methodArgs = {} + ) + }) public void test_supportsSavepoints() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1965,6 +3214,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSchemasInDataManipulation() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSchemasInDataManipulation", + methodArgs = {} + ) + }) public void test_supportsSchemasInDataManipulation() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1972,6 +3230,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSchemasInIndexDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSchemasInIndexDefinitions", + methodArgs = {} + ) + }) public void test_supportsSchemasInIndexDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1979,6 +3246,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSchemasInPrivilegeDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSchemasInPrivilegeDefinitions", + methodArgs = {} + ) + }) public void test_supportsSchemasInPrivilegeDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality @@ -1987,6 +3263,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSchemasInProcedureCalls() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSchemasInProcedureCalls", + methodArgs = {} + ) + }) public void test_supportsSchemasInProcedureCalls() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -1994,6 +3279,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSchemasInTableDefinitions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSchemasInTableDefinitions", + methodArgs = {} + ) + }) public void test_supportsSchemasInTableDefinitions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2001,6 +3295,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSelectForUpdate() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsSelectForUpdate", + methodArgs = {} + ) + }) public void test_supportsSelectForUpdate() throws SQLException { insertNewRecord(); @@ -2022,6 +3325,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsStatementPooling() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsStatementPooling", + methodArgs = {} + ) + }) public void test_supportsStatementPooling() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2029,6 +3341,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsStoredProcedures() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsStoredProcedures", + methodArgs = {} + ) + }) public void test_supportsStoredProcedures() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2036,6 +3357,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSubqueriesInComparisons() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSubqueriesInComparisons", + methodArgs = {} + ) + }) public void test_supportsSubqueriesInComparisons() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2043,6 +3373,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSubqueriesInExists() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsSubqueriesInExists", + methodArgs = {} + ) + }) public void test_supportsSubqueriesInExists() throws SQLException { insertNewRecord(); @@ -2066,6 +3405,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSubqueriesInIns() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSubqueriesInIns", + methodArgs = {} + ) + }) public void test_supportsSubqueriesInIns() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2073,6 +3421,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsSubqueriesInQuantifieds() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsSubqueriesInQuantifieds", + methodArgs = {} + ) + }) public void test_supportsSubqueriesInQuantifieds() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2080,6 +3437,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsTableCorrelationNames() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "supportsTableCorrelationNames", + methodArgs = {} + ) + }) public void test_supportsTableCorrelationNames() throws SQLException { insertNewRecord(); @@ -2105,6 +3471,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsTransactionIsolationLevel(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "supportsTransactionIsolationLevel", + methodArgs = {int.class} + ) + }) public void test_supportsTransactionIsolationLevelI() throws SQLException { assertFalse("database supports TRANSACTION_NONE isolation level", meta .supportsTransactionIsolationLevel(Connection.TRANSACTION_NONE)); @@ -2132,6 +3508,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsTransactions() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsTransactions", + methodArgs = {} + ) + }) public void test_supportsTransactions() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2139,6 +3524,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsUnion() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsUnion", + methodArgs = {} + ) + }) public void test_supportsUnion() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2146,6 +3540,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#supportsUnionAll() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "supportsUnionAll", + methodArgs = {} + ) + }) public void test_supportsUnionAll() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2153,6 +3556,16 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#updatesAreDetected(int) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed. " + + "Verification with invalid parameters missed.", + targets = { + @TestTarget( + methodName = "updatesAreDetected", + methodArgs = {int.class} + ) + }) public void test_updatesAreDetectedI() throws SQLException { assertFalse( "visible row update can be detected for TYPE_FORWARD_ONLY type", @@ -2170,6 +3583,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#usesLocalFilePerTable() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "usesLocalFilePerTable", + methodArgs = {} + ) + }) public void test_usesLocalFilePerTable() throws SQLException { // TODO: JDBC does not implement this functionality } @@ -2177,6 +3599,15 @@ public class DatabaseMetaDataTest extends TestCase { /** * @tests java.sql.DatabaseMetaData#usesLocalFiles() */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "usesLocalFiles", + methodArgs = {} + ) + }) public void test_usesLocalFiles() throws SQLException { // TODO: JDBC does not implement this functionality } diff --git a/sql/src/test/java/tests/java/sql/DeleteFunctionalityTest.java b/sql/src/test/java/tests/java/sql/DeleteFunctionalityTest.java index f00a7cf..621cf60 100755 --- a/sql/src/test/java/tests/java/sql/DeleteFunctionalityTest.java +++ b/sql/src/test/java/tests/java/sql/DeleteFunctionalityTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; @@ -30,7 +35,7 @@ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; - +@TestTargetClass(Statement.class) public class DeleteFunctionalityTest extends TestCase { private static Connection conn = null; @@ -121,6 +126,15 @@ public class DeleteFunctionalityTest extends TestCase { * @tests DeleteFunctionalityTest#testDelete1(). Deletes row with no * referencing ones and RESTRICT action */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Deletes row with no referencing ones and RESTRICT action", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testDelete1() throws SQLException { DatabaseCreator.fillFKStrictTable(conn); statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE @@ -147,6 +161,15 @@ public class DeleteFunctionalityTest extends TestCase { * @tests DeleteFunctionalityTest#testDelete3(). Deletes all referencing * rows and then deletes referenced one */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Deletes all referencing rows and then deletes referenced one", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testDelete3() throws SQLException { statement.execute("DELETE FROM " + DatabaseCreator.FKSTRICT_TABLE + " WHERE name_id = 1;"); @@ -158,6 +181,15 @@ public class DeleteFunctionalityTest extends TestCase { * @tests DeleteFunctionalityTest#testDelete4(). Deletes row with no * referencing ones and CASCADE action */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Deletes row with no referencing ones and CASCADE action", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testDelete4() throws SQLException { DatabaseCreator.fillFKCascadeTable(conn); statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE @@ -169,6 +201,21 @@ public class DeleteFunctionalityTest extends TestCase { * referencing ones and CASCADE action - expecting all referencing * rows will also be deleted */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Attempts to delete row with referencing " + + "ones and CASCADE action - expecting all referencing rows " + + "will also be deleted", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testDelete5() throws SQLException { statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE + " WHERE id = 1;"); @@ -201,6 +248,15 @@ public class DeleteFunctionalityTest extends TestCase { * @tests DeleteFunctionalityTest#testDelete7(). Deletes rows using * PreparedStatement */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Deletes rows using PreparedStatement", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testDelete7() throws SQLException { DatabaseCreator.fillTestTable5(conn); PreparedStatement stat = conn.prepareStatement("DELETE FROM " diff --git a/sql/src/test/java/tests/java/sql/InsertFunctionalityTest.java b/sql/src/test/java/tests/java/sql/InsertFunctionalityTest.java index 7ad2d3e..da9e045 100755 --- a/sql/src/test/java/tests/java/sql/InsertFunctionalityTest.java +++ b/sql/src/test/java/tests/java/sql/InsertFunctionalityTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; @@ -31,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Statement.class) public class InsertFunctionalityTest extends TestCase { private static Connection conn = null; @@ -137,6 +143,16 @@ public class InsertFunctionalityTest extends TestCase { * @tests InsertFunctionalityTest#testInsert1(). Attempts to insert row into * table with integrity checking */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Attempts to insert row into " + + "table with integrity checking", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testInsert1() throws SQLException { DatabaseCreator.fillParentTable(conn); DatabaseCreator.fillFKStrictTable(conn); @@ -152,6 +168,16 @@ public class InsertFunctionalityTest extends TestCase { * table with integrity checking when row has incorrect foreign key * value - expecting SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Attempts to insert row into table with " + + "integrity checking when row has incorrect foreign key value - expecting SQLException", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testInsert2() throws SQLException { DatabaseCreator.fillParentTable(conn); DatabaseCreator.fillFKStrictTable(conn); @@ -178,6 +204,19 @@ public class InsertFunctionalityTest extends TestCase { * @tests InsertFunctionalityTest#testInsert3(). Tests INSERT ... SELECT * functionality */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Tests INSERT ... SELECT functionality", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testInsert3() throws SQLException { DatabaseCreator.fillParentTable(conn); DatabaseCreator.fillFKStrictTable(conn); @@ -195,6 +234,19 @@ public class InsertFunctionalityTest extends TestCase { * @tests InsertFunctionalityTest#testInsert4(). Tests INSERT ... SELECT * with expressions in SELECT query */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Tests INSERT ... SELECT with expressions in SELECT query", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testInsert4() throws SQLException { DatabaseCreator.fillSimpleTable1(conn); statement.execute("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE2 @@ -213,6 +265,19 @@ public class InsertFunctionalityTest extends TestCase { * @tests InsertFunctionalityTest#testInsert5(). Inserts multiple rows using * UNION ALL */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Inserts multiple rows using UNION ALL", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testInsert5() throws SQLException { statement.execute("INSERT INTO " + DatabaseCreator.TEST_TABLE5 + " SELECT 1 as testId, 2 as testValue " @@ -229,6 +294,15 @@ public class InsertFunctionalityTest extends TestCase { * @tests InsertFunctionalityTest#testInsert6(). Tests INSERT with * PreparedStatement */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Tests INSERT with PreparedStatement", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testInsertPrepared() throws SQLException { PreparedStatement stat = conn.prepareStatement("INSERT INTO " + DatabaseCreator.TEST_TABLE5 + " VALUES(?, ?)"); diff --git a/sql/src/test/java/tests/java/sql/MultiThreadAccessTest.java b/sql/src/test/java/tests/java/sql/MultiThreadAccessTest.java index b88aa4e..6770624 100755 --- a/sql/src/test/java/tests/java/sql/MultiThreadAccessTest.java +++ b/sql/src/test/java/tests/java/sql/MultiThreadAccessTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.math.BigDecimal; import java.sql.Connection; import java.sql.ResultSet; @@ -32,6 +37,7 @@ import junit.framework.TestSuite; import tests.support.ThreadPool; +@TestTargetClass(Statement.class) public class MultiThreadAccessTest extends TestCase { private static Connection conn; @@ -127,6 +133,16 @@ public class MultiThreadAccessTest extends TestCase { * * @throws SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: A few threads execute select operation " + + "in the same time for one table in the database.", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_MultipleAccessToOneTable() throws SQLException { for (int i = 0; i < numThreads; i++) { threadPool.runTask(createTask1(i)); @@ -140,6 +156,16 @@ public class MultiThreadAccessTest extends TestCase { * * @throws SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: A few threads execute select operation " + + "in the same time for different tables in the database", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_MultipleAccessToSeveralTables() throws SQLException { threadPool.runTask(createTask1(1)); threadPool.runTask(createTask2(2)); @@ -153,6 +179,16 @@ public class MultiThreadAccessTest extends TestCase { * * @throws SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: A few threads execute update, insert " + + "and delete operations in the same time for one table in the database", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_MultipleOperationsInSeveralTables() throws SQLException { int id1 = numOfRecords - 1; threadPool.runTask(createTask4(id1)); @@ -208,6 +244,16 @@ public class MultiThreadAccessTest extends TestCase { * * @throws SQLException */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functional test: A few threads execute update operation " + + "in the same time for one tables in the database", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_MultipleUpdatesInOneTables() throws SQLException { int id = 1; String field = "field3"; diff --git a/sql/src/test/java/tests/java/sql/SelectFunctionalityTest.java b/sql/src/test/java/tests/java/sql/SelectFunctionalityTest.java index a0ded6a..9c6bf20 100755 --- a/sql/src/test/java/tests/java/sql/SelectFunctionalityTest.java +++ b/sql/src/test/java/tests/java/sql/SelectFunctionalityTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.io.CharArrayReader; import java.math.BigDecimal; import java.sql.Connection; @@ -37,6 +42,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Statement.class) public class SelectFunctionalityTest extends TestCase { private static Connection conn; @@ -137,6 +143,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectSimple(). Selects all records * from the table */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects all records from the table", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectSimple() throws SQLException { String sql = "SELECT * FROM " + DatabaseCreator.TEST_TABLE2; ResultSet result = statement.executeQuery(sql); @@ -180,6 +195,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectPrepared(). Selects all records * from the table using parametric query */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects all records from the table using parametric query", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectPrepared() throws SQLException { String sql = "SELECT finteger, ftext, fcharacter, fdecimal, fnumeric," + " fsmallint, ffloat, freal, fdouble, fdate, ftime" + " FROM " @@ -242,6 +266,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SubSelect(). Selects records from the * table using subselect */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from the table using subselect", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SubSelect() throws SQLException { String sql = "SELECT finteger," + " (SELECT ftext FROM " + DatabaseCreator.TEST_TABLE2 + " WHERE finteger = 1) as ftext" @@ -271,6 +304,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectThreeTables(). Selects records * from a few tables */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a few tables", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectThreeTables() throws SQLException { String sql = "SELECT onum, " + DatabaseCreator.ORDERS_TABLE + ".cnum" + " FROM " + DatabaseCreator.SALESPEOPLE_TABLE + ", " @@ -309,6 +351,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectThreeTables(). Selects records * from a table using union */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using union", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectUnionItself() throws SQLException { String sql = "SELECT b.cnum, b.cname" + " FROM " + DatabaseCreator.CUSTOMERS_TABLE + " a, " @@ -337,6 +388,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectLeftOuterJoin(). Selects * records from a table using left join */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using left join", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectLeftOuterJoin() throws SQLException { String sql = "SELECT distinct s.snum as ssnum, c.snum as ccnum FROM " + DatabaseCreator.CUSTOMERS_TABLE + " c left outer join " @@ -400,6 +460,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectGroupBy(). Selects records from * a table using group by */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using group by", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectGroupBy() throws SQLException { String selectQuery = "SELECT rating, SUM(snum) AS sum FROM " + DatabaseCreator.CUSTOMERS_TABLE + " GROUP BY rating"; @@ -427,6 +496,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectOrderBy(). Selects records from * a table using order by */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using order by", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectOrderBy() throws SQLException { String selectQuery = "SELECT onum FROM " + DatabaseCreator.ORDERS_TABLE + " ORDER BY onum"; @@ -460,6 +538,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectDistinct(). Selects records * from a table using distinct */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using distinct", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectDistinct() throws SQLException { String selectQuery = "SELECT DISTINCT rating FROM " + DatabaseCreator.CUSTOMERS_TABLE; @@ -484,7 +571,16 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectAgregateFunctions(). Selects * records from a table using agregate functions */ - public void test_SelectAgregateFunctions() throws SQLException { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using agregate functions", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) + public void _test_SelectAgregateFunctions() throws SQLException { String selectCount = "SELECT count(onum) as count FROM " + DatabaseCreator.ORDERS_TABLE; String selectSum = "SELECT sum(onum) as sum FROM " @@ -521,6 +617,15 @@ public class SelectFunctionalityTest extends TestCase { * @tests SelectFunctionalityTest#test_SelectHaving(). Selects records from * a table using having */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Selects records from a table using having", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void test_SelectHaving() throws SQLException { String selectQuery = "SELECT snum, max(amt) AS max FROM " + DatabaseCreator.ORDERS_TABLE diff --git a/sql/src/test/java/tests/java/sql/StressTest.java b/sql/src/test/java/tests/java/sql/StressTest.java index fbafe82..fc87487 100755 --- a/sql/src/test/java/tests/java/sql/StressTest.java +++ b/sql/src/test/java/tests/java/sql/StressTest.java @@ -16,8 +16,14 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; +import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -32,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Connection.class) public class StressTest extends TestCase { Vector<Connection> vc = new Vector<Connection>(); @@ -108,6 +115,15 @@ public class StressTest extends TestCase { * @tests StressTest#testManyConnectionsUsingOneThread(). Create many * connections to the DataBase using one thread. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Stress test: Create many connections to the DataBase using one thread", + targets = { + @TestTarget( + methodName = "getMetaData", + methodArgs = {} + ) + }) public void testManyConnectionsUsingOneThread() { try { int maxConnections = getConnectionNum(); @@ -123,6 +139,15 @@ public class StressTest extends TestCase { * @tests StressTest#testManyConnectionsUsingManyThreads(). Create many * connections to the DataBase using some threads. */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Stress test: Create many connections to the DataBase using some threads", + targets = { + @TestTarget( + methodName = "DriverManager.getConnection", + methodArgs = {String.class, String.class, String.class} + ) + }) public void testManyConnectionsUsingManyThreads() { int numTasks = getConnectionNum(); @@ -152,6 +177,15 @@ public class StressTest extends TestCase { * @tests StressTest#testInsertOfManyRowsUsingOneThread(). Insert a lot of * records to the DataBase using a maximum number of connections. */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "", + methodArgs = {} + ) + }) public void testInsertOfManyRowsUsingOneThread() { // TODO Crashes VM. Fix later. /* @@ -172,6 +206,15 @@ public class StressTest extends TestCase { /** * @tests */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Empty test", + targets = { + @TestTarget( + methodName = "", + methodArgs = {} + ) + }) public void testInsertOfManyRowsUsingManyThreads() { // TODO Crashes VM. Fix later. /* diff --git a/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest.java b/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest.java index b9761cd..e4e6e49 100755 --- a/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest.java +++ b/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.math.BigDecimal; import java.sql.Connection; import java.sql.DatabaseMetaData; @@ -31,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Statement.class) public class UpdateFunctionalityTest extends TestCase { private static final int numberOfRecords = 20; @@ -119,6 +125,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate1(). Updates all values in one * column in the table */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates all values in one column in the table", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate1() { String newValue = "newValue"; String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 @@ -144,6 +163,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate2(). Updates values in one * column in the table using where condition in update command */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates values in one column in the table using where condition in update command", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate2() { String newValue = "newValue"; String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 @@ -176,6 +208,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate3(). Updates values in a several * columns in the table */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates values in a several columns in the table", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate3() { int newValue1 = -1; int newValue2 = -2; @@ -205,6 +250,20 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate4(). Updates values in a several * columns in the table using where condition in update command */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates values in a several " + + "columns in the table using where condition in update command", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate4() { int newValue1 = -1; int newValue2 = -2; @@ -244,6 +303,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate5(). Updates values in one * columns in the table using condition */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates values in one columns in the table using condition", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate5() { int factor = 3; String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 @@ -282,6 +354,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate6(). Sets value of field2 to * default */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Sets value of field2 to default", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate6() { String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field2='1'"; @@ -309,6 +394,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate7(). Updates records in the * table using subquery in update command */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates records in the table using subquery in update command", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate7() { String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field2='1' WHERE id < ( SELECT COUNT(*) FROM " @@ -342,6 +440,19 @@ public class UpdateFunctionalityTest extends TestCase { * @tests UpdateFunctionalityTest#testUpdate8(). Sets value of field2 to * NULL */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Sets value of field2 to NULL", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate8() { String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field2=NULL"; diff --git a/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java b/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java index 7bcbff6..e64ecb2 100755 --- a/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java +++ b/sql/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java @@ -16,6 +16,11 @@ package tests.java.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; @@ -31,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Statement.class) public class UpdateFunctionalityTest2 extends TestCase { private static Connection conn = null; @@ -137,6 +143,15 @@ public class UpdateFunctionalityTest2 extends TestCase { * @tests UpdateFunctionalityTest2#testUpdate1(). Updates row with no * referencing ones and RESTRICT action */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates row with no referencing ones and RESTRICT action", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testUpdate1() throws SQLException { DatabaseCreator.fillFKStrictTable(conn); statement.execute("UPDATE " + DatabaseCreator.PARENT_TABLE @@ -165,6 +180,15 @@ public class UpdateFunctionalityTest2 extends TestCase { * @tests UpdateFunctionalityTest2#testUpdate3(). Deletes all referencing * rows and then updates referenced one */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Deletes all referencing rows and then updates referenced one", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testUpdate3() throws SQLException { DatabaseCreator.fillFKStrictTable(conn); statement.execute("DELETE FROM " + DatabaseCreator.FKSTRICT_TABLE @@ -195,6 +219,20 @@ public class UpdateFunctionalityTest2 extends TestCase { * referencing ones and CASCADE action - expecting that all * referencing rows will also be updated */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates row with referencing ones and " + + "CASCADE action - expecting that all referencing rows will also be updated", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate5() throws SQLException { DatabaseCreator.fillFKCascadeTable(conn); statement.execute("UPDATE " + DatabaseCreator.PARENT_TABLE @@ -251,6 +289,19 @@ public class UpdateFunctionalityTest2 extends TestCase { * @tests UpdateFunctionalityTest2#testUpdate8(). Updates table using scalar * subquery as new field value */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates table using scalar subquery as new field value", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ), + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate8() throws SQLException { statement.execute("UPDATE " + DatabaseCreator.SIMPLE_TABLE3 + " SET speed = (SELECT MAX(speed) FROM " @@ -272,6 +323,15 @@ public class UpdateFunctionalityTest2 extends TestCase { * @tests UpdateFunctionalityTest2#testUpdate9(). Updates table using * PreparedStatement */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Functionality test: Updates table using PreparedStatement", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) public void testUpdate9() throws SQLException { DatabaseCreator.fillTestTable5(conn); PreparedStatement stat = conn.prepareStatement("UPDATE " diff --git a/sql/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java b/sql/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java new file mode 100644 index 0000000..295af69 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java @@ -0,0 +1,45 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.ConnectionEvent; +import javax.sql.ConnectionEventListener; + +@TestTargetClass(ConnectionEventListener.class) +public class ConnectionEventListenerTest extends TestCase { + + /** + * @tests {@link javax.sql.ConnectionEventListener#connectionClosed(javax.sql.ConnectionEvent)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies that the listener is notified when a connection closed regularly.", + targets = { @TestTarget(methodName = "testConnectionEventPooledConnection", + methodArgs = {ConnectionEvent.class}) + } + ) + + public void testConnectionClosed() { + fail("Not yet implemented"); // TODO + } + + /** + * @test {@link javax.sql.ConnectionEventListener#connectionErrorOccurred(ConnectionEvent)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies that the listener is notified when a connection is unavailable because an error has occurred.", + targets = { @TestTarget(methodName = "testConnectionEventPooledConnection", + methodArgs = {ConnectionEvent.class}) + } + ) + public void testConnectionErrorOccurred() { + fail("Not yet implemented"); // TODO + } + +} diff --git a/sql/src/test/java/tests/javax/sql/ConnectionEventTest.java b/sql/src/test/java/tests/javax/sql/ConnectionEventTest.java new file mode 100644 index 0000000..ea62edf --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/ConnectionEventTest.java @@ -0,0 +1,64 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import java.sql.SQLException; + +import javax.sql.ConnectionEvent; +import javax.sql.PooledConnection; + +@TestTargetClass(ConnectionEvent.class) +public class ConnectionEventTest extends TestCase { + + /** + * @tests {@link javax.sql.ConnectionEvent#ConnectionEvent(PooledConnection)} + * @see {@link org.apache.harmony.sql.tests.javax.sql.ConnectionEventTest} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies ConnectionEvent() constructor for the normal case.", + targets = { @TestTarget(methodName = "testConnectionEventPooledConnection", + methodArgs = {PooledConnection.class}) + } + ) + + public void testConnectionEventPooledConnection() { + // delegate to package org.apache.harmony.sql.tests.javax.sql. + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionEvent#ConnectionEvent(PooledConnection, SQLException)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies ConnectionEvent() constructor for the abnormal case that an error has occurred on the pooled connection.", + targets = { @TestTarget(methodName = "testConnectionEventPooledConnection", + methodArgs = {PooledConnection.class,SQLException.class}) + } + ) + public void testConnectionEventPooledConnectionSQLException() { + // delegate to org.apache.harmony.sql.tests.javax.sql. + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionEvent#getSQLException()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "Verifies that a SQLException is thrown after an error has occurred in the connection pool.", + targets = { @TestTarget(methodName = "testGetSQLException", + methodArgs = {}) + } + ) + public void testGetSQLException() { + fail("Not yet implemented"); // TODO + } + +} diff --git a/sql/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java b/sql/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java new file mode 100644 index 0000000..9cb5d12 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java @@ -0,0 +1,102 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import java.io.PrintWriter; + +import javax.sql.ConnectionPoolDataSource; + + +@TestTargetClass(ConnectionPoolDataSource.class) +public class ConnectionPoolDataSourceTest extends TestCase { + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#getLoginTimeout()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getLoginTimeout", + methodArgs = {ConnectionPoolDataSource.class}) + } + ) + public void testGetLoginTimeout() { + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#getLogWriter()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getLogWriter", + methodArgs = {ConnectionPoolDataSource.class}) + } + ) + public void testGetLogWriter() { + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#getPooledConnection()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getPooledConnection", + methodArgs = {ConnectionPoolDataSource.class}) + } + ) + public void testGetPooledConnection() { + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#getPooledConnection(String, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getPooledConnection", + methodArgs = {ConnectionPoolDataSource.class}) + } + ) + public void testGetPooledConnectionStringString() { + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#setLoginTimeout(int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setLoginTimeout", + methodArgs = {int.class}) + } + ) + public void testSetLoginTimeout() { + fail("Not yet implemented"); // TODO + } + + /** + * @tests {@link javax.sql.ConnectionPoolDataSource#setLogWriter(java.io.PrintWriter)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setLogWriter", + methodArgs = {PrintWriter.class}) + } + ) + public void testSetLogWriter() { + fail("Not yet implemented"); // TODO + } + +} diff --git a/sql/src/test/java/tests/javax/sql/DataSourceTest.java b/sql/src/test/java/tests/javax/sql/DataSourceTest.java new file mode 100644 index 0000000..c534e6e --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/DataSourceTest.java @@ -0,0 +1,100 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.DataSource; + +@TestTargetClass(DataSource.class) +public class DataSourceTest extends TestCase { + + /** + * @tests {@link javax.sql.DataSource#getConnection()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getConnetion", + methodArgs = {}) + } + ) + public void testGetConnection() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.DataSource#getConnection(String, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getConnection", + methodArgs = {String.class,String.class}) + } + ) + public void testGetConnectionStringString() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.DataSource#getLoginTimeout()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getLoginTimeout", + methodArgs = {}) + } + ) + public void testGetLoginTimeout() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.DataSource#getLogWriter()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getLogWriter", + methodArgs = {}) + } + ) + public void testGetLogWriter() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.DataSource#setLoginTimeout(int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setLoginTimeout", + methodArgs = {int.class}) + } + ) + public void testSetLoginTimeout() { + fail("Not yet implemented"); + } + + + /** + * @tests {@link javax.sql.DataSource#setLogWriter(java.io.PrintWriter)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setLoginTimeout", + methodArgs = {int.class}) + } + ) + public void testSetLogWriter() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/PooledConnectionTest.java b/sql/src/test/java/tests/javax/sql/PooledConnectionTest.java new file mode 100644 index 0000000..614322a --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/PooledConnectionTest.java @@ -0,0 +1,72 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.ConnectionEventListener; + +@TestTargetClass(PooledConnectionTest.class) +public class PooledConnectionTest extends TestCase { + + /** + * @tests {@link javax.sql.PooledConnection#addConnectionEventListener(javax.sql.ConnectionEventListener)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "addConnectionEventListener", + methodArgs = {ConnectionEventListener.class}) + } + ) + public void testAddConnectionEventListener() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.PooledConnection#close()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "close", + methodArgs = {}) + } + ) + public void testClose() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.PooledConnection#getConnection()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getConnection", + methodArgs = {}) + } + ) + public void testGetConnection() { + fail("Not yet implemented"); + } + + + /** + * @tests {@link javax.sql.PooledConnection#removeConnectionEventListener(ConnectionEventListener)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getConnection", + methodArgs = {ConnectionEventListener.class}) + } + ) + public void testRemoveConnectionEventListener() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/RowSetInternalTest.java b/sql/src/test/java/tests/javax/sql/RowSetInternalTest.java new file mode 100644 index 0000000..1521554 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/RowSetInternalTest.java @@ -0,0 +1,86 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.RowSetInternal; +import javax.sql.RowSetMetaData; + +@TestTargetClass(RowSetInternal.class) +public class RowSetInternalTest extends TestCase { + + /** + * @tests {@link javax.sql.RowSetInternal#getConnection()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getConnection", + methodArgs = {}) + } + ) + public void testGetConnection() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetInternal#getOriginal()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getOriginal", + methodArgs = {}) + } + ) + public void testGetOriginal() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetInternal#getOriginalRow()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getOriginalRow", + methodArgs = {}) + } + ) + public void testGetOriginalRow() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetInternal#getOriginalRow()} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getOriginalRow", + methodArgs = {}) + } + ) + public void testGetParams() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetInternal#setMetaData(javax.sql.RowSetMetaData)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "getOriginalRow", + methodArgs = {RowSetMetaData.class}) + } + ) + public void testSetMetaData() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/RowSetMetaDataTest.java b/sql/src/test/java/tests/javax/sql/RowSetMetaDataTest.java new file mode 100644 index 0000000..acaffb8 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/RowSetMetaDataTest.java @@ -0,0 +1,258 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.RowSetMetaData; + +/** + * @author AGR + * + */ +@TestTargetClass(RowSetMetaData.class) +public class RowSetMetaDataTest extends TestCase { + + /** + * @tests {@link javax.sql.RowSetMetaData#setAutoIncrement(int, boolean)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "etAutoIncrement", + methodArgs = {int.class,boolean.class}) + } + ) + public void testSetAutoIncrement() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setCaseSensitive(int, boolean)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setCaseSensitive", + methodArgs = {int.class,boolean.class}) + } + ) + public void testSetCaseSensitive() { + fail("Not yet implemented"); + } + + + /** + * @tests {@link javax.sql.RowSetMetaData#setCatalogName(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setCatalogName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetCatalogName() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnCount(int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnCount", + methodArgs = {int.class}) + } + ) + public void testSetColumnCount() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnDisplaySize(int, int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnDisplaySize", + methodArgs = {int.class,int.class}) + } + ) + public void testSetColumnDisplaySize() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnLabel(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setCaseSensitive", + methodArgs = {int.class,String.class}) + } + ) + public void testSetColumnLabel() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnName(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetColumnName() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnType(int, int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnName", + methodArgs = {int.class,int.class}) + } + ) + public void testSetColumnType() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setColumnTypeName(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnTypeName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetColumnTypeName() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setCurrency(int, boolean)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setCurrency", + methodArgs = {int.class,boolean.class}) + } + ) + public void testSetCurrency() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setNullable(int, int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setNullable", + methodArgs = {int.class,int.class}) + } + ) + public void testSetNullable() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setPrecision(int, int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetPrecision() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setScale(int, int)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setScale", + methodArgs = {int.class,int.class}) + } + ) + public void testSetScale() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setSchemaName(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setSchemaName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetSchemaName() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setSearchable(int, boolean)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setSearchable", + methodArgs = {int.class,String.class}) + } + ) + public void testSetSearchable() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setSigned(int, boolean)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setSigned", + methodArgs = {int.class,boolean.class}) + } + ) + public void testSetSigned() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSetMetaData#setTableName(int, String)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setTableName", + methodArgs = {int.class,String.class}) + } + ) + public void testSetTableName() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/RowSetReaderTest.java b/sql/src/test/java/tests/javax/sql/RowSetReaderTest.java new file mode 100644 index 0000000..3519ec5 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/RowSetReaderTest.java @@ -0,0 +1,30 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.RowSetInternal; +import javax.sql.RowSetReader; + +@TestTargetClass(RowSetReader.class) +public class RowSetReaderTest extends TestCase { + + /** + * @tests {@link javax.sql.RowSetReader#readData(RowSetInternal)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnName", + methodArgs = {RowSetInternal.class}) + } + ) + public void testReadData() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/RowSetTest.java b/sql/src/test/java/tests/javax/sql/RowSetTest.java new file mode 100644 index 0000000..4ec1db1 --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/RowSetTest.java @@ -0,0 +1,295 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.RowSet; +import javax.sql.RowSetListener; + +/** + * Annotation conventions for setters and getters? + * @author andrea.groessbauer@noser.com + * + */ +@TestTargetClass(RowSet.class) +public class RowSetTest extends TestCase { + + /** + * Sets up the mock RowSet. + */ + @Override + protected void setUp() { + // Reuse org.apache.harmony.sql.tests.javax.sql.Impl_RowSet.java + } + + /** + * @tests {@link javax.sql.RowSet#addRowSetListener(javax.sql.RowSetListener)}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = { @TestTarget(methodName = "addRowSetListener", + methodArgs = {RowSetListener.class}) + } + ) + public void testAddRowSetListener() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSet#clearParameters()}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = { @TestTarget(methodName = "clearParameters", + methodArgs = {}) + } + ) + public void testClearParameters() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSet#addRowSetListener(javax.sql.RowSetListener)}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = { @TestTarget(methodName = "addRowSetListener", + methodArgs = {RowSetListener.class}) + } + ) + public void testExecute() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSet#getCommand()}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = { @TestTarget(methodName = "getCommand", + methodArgs = {}) + } + ) + public void testSetGetCommand() { + fail("Not yet implemented"); + } + + /** + * @tests {@link javax.sql.RowSet#getDataSourceName()}. + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = { @TestTarget(methodName = "getDataSourceName", + methodArgs = {}) + } + ) + public void testSetGetDataSourceName() { + fail("Not yet implemented"); + } + + public void testSetGetEscapeProcessing() { + fail("Not yet implemented"); + } + + public void testSetGetMaxFieldSize() { + fail("Not yet implemented"); + } + + public void testSetGetMaxRows() { + fail("Not yet implemented"); + } + + public void testSetGetPassword() { + fail("Not yet implemented"); + } + + public void testSetGetQueryTimeout() { + fail("Not yet implemented"); + } + + public void testSetGetTransactionIsolation() { + fail("Not yet implemented"); + } + + public void testSetGetTypeMap() { + fail("Not yet implemented"); + } + + public void testSetGetUrl() { + fail("Not yet implemented"); + } + + public void testSetGetUsername() { + fail("Not yet implemented"); + } + + public void testIsReadOnly() { + fail("Not yet implemented"); + } + + public void testRemoveRowSetListener() { + fail("Not yet implemented"); + } + + public void testSetGetArray() { + fail("Not yet implemented"); + } + + public void testSetGetAsciiStream() { + fail("Not yet implemented"); + } + + public void testSetGetBigDecimal() { + fail("Not yet implemented"); + } + + public void testSetGetBinaryStream() { + fail("Not yet implemented"); + } + + public void testSetGetBlob() { + fail("Not yet implemented"); + } + + public void testSetGetBoolean() { + fail("Not yet implemented"); + } + + public void testSetGetByte() { + fail("Not yet implemented"); + } + + public void testSetGetBytes() { + fail("Not yet implemented"); + } + + public void testSetGetCharacterStream() { + fail("Not yet implemented"); + } + + public void testSetGetClob() { + fail("Not yet implemented"); + } + + public void testSetGetConcurrency() { + fail("Not yet implemented"); + } + + public void testSetGetDateIntDate() { + fail("Not yet implemented"); + } + + public void testSetDateIntDateCalendar() { + fail("Not yet implemented"); + } + + public void testSetGetDouble() { + fail("Not yet implemented"); + } + + public void testSetGetFloat() { + fail("Not yet implemented"); + } + + public void testSetGetInt() { + fail("Not yet implemented"); + } + + public void testSetGetLong() { + fail("Not yet implemented"); + } + + public void testSetGetGetMaxFieldSize() { + fail("Not yet implemented"); + } + + public void testSetGetNullIntInt() { + fail("Not yet implemented"); + } + + public void testSetGetNullIntIntString() { + fail("Not yet implemented"); + } + + public void testSetGetObjectIntObject() { + fail("Not yet implemented"); + } + + public void testSetGetObjectIntObjectInt() { + fail("Not yet implemented"); + } + + public void testSetGetObjectIntObjectIntInt() { + fail("Not yet implemented"); + } + + public void testSetPassword() { + fail("Not yet implemented"); + } + + public void testSetQueryTimeout() { + fail("Not yet implemented"); + } + + public void testSetReadOnly() { + fail("Not yet implemented"); + } + + public void testSetRef() { + fail("Not yet implemented"); + } + + public void testSetShort() { + fail("Not yet implemented"); + } + + public void testSetString() { + fail("Not yet implemented"); + } + + public void testSetTimeIntTime() { + fail("Not yet implemented"); + } + + public void testSetTimeIntTimeCalendar() { + fail("Not yet implemented"); + } + + public void testSetTimestampIntTimestamp() { + fail("Not yet implemented"); + } + + public void testSetTimestampIntTimestampCalendar() { + fail("Not yet implemented"); + } + + public void testSetTransactionIsolation() { + fail("Not yet implemented"); + } + + public void testSetType() { + fail("Not yet implemented"); + } + + public void testSetTypeMap() { + fail("Not yet implemented"); + } + + public void testSetUrl() { + fail("Not yet implemented"); + } + + public void testSetUsername() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/javax/sql/RowSetWriterTest.java b/sql/src/test/java/tests/javax/sql/RowSetWriterTest.java new file mode 100644 index 0000000..c6b51ff --- /dev/null +++ b/sql/src/test/java/tests/javax/sql/RowSetWriterTest.java @@ -0,0 +1,30 @@ +package tests.javax.sql; + +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; + +import junit.framework.TestCase; + +import javax.sql.RowSetInternal; +import javax.sql.RowSetWriter; + +@TestTargetClass(RowSetWriter.class) +public class RowSetWriterTest extends TestCase { + + /** + * @tests {@link javax.sql.RowSetWriter#writeData(javax.sql.RowSetInternal)} + */ + @TestInfo( + level = TestLevel.TODO, + purpose = "", + targets = {@TestTarget(methodName = "setColumnName", + methodArgs = {RowSetInternal.class}) + } + ) + public void testWriteData() { + fail("Not yet implemented"); + } + +} diff --git a/sql/src/test/java/tests/sql/ConnectionTest.java b/sql/src/test/java/tests/sql/ConnectionTest.java index ba6fff2..64d78d2 100755 --- a/sql/src/test/java/tests/sql/ConnectionTest.java +++ b/sql/src/test/java/tests/sql/ConnectionTest.java @@ -16,6 +16,11 @@ package tests.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.SQLWarning; @@ -29,11 +34,21 @@ import java.sql.CallableStatement; import junit.framework.Test; +@TestTargetClass(Connection.class) public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#createStatement() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "createStatement", + methodArgs = {} + ) + }) public void testCreateStatement() { Statement statement = null; @@ -57,6 +72,15 @@ public class ConnectionTest extends SQLTest { * @test java.sql.Connection#createStatement(int resultSetType, int * resultSetConcurrency) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "createStatement", + methodArgs = {int.class, int.class} + ) + }) public void testCreateStatement_int_int() { Statement st = null; ResultSet rs = null; @@ -135,14 +159,14 @@ public class ConnectionTest extends SQLTest { } try { - // exception is not specified for this case + // exception is not specified for this case conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, -1); } catch (SQLException sqle) { // expected } try { - // exception is not specified for this case + // exception is not specified for this case conn.createStatement(Integer.MIN_VALUE, ResultSet.CONCUR_READ_ONLY); } catch (SQLException sqle) { // expected @@ -153,6 +177,15 @@ public class ConnectionTest extends SQLTest { * @test java.sql.Connection#createStatement(int resultSetType, int * resultSetConcurrency, int resultSetHoldability) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "createStatement", + methodArgs = {int.class, int.class, int.class} + ) + }) public void testCreateStatement_int_int_int() { Statement st = null; try { @@ -213,6 +246,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#getMetaData() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMetaData", + methodArgs = {} + ) + }) public void testGetMetaData() { try { DatabaseMetaData md = conn.getMetaData(); @@ -325,6 +367,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#getAutoCommit() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getAutoCommit", + methodArgs = {} + ) + }) public void testGetAutoCommit() { try { conn.setAutoCommit(true); @@ -342,6 +393,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#setAutoCommit(boolean) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "setAutoCommit", + methodArgs = {boolean.class} + ) + }) public void testSetAutoCommit() { Statement st = null; ResultSet rs = null; @@ -390,6 +450,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#isReadOnly() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "isReadOnly", + methodArgs = {} + ) + }) public void testIsReadOnly() { try { conn.setReadOnly(true); @@ -408,7 +477,16 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#setReadOnly(boolean) */ - public void testSetReadOnly() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setReadOnly", + methodArgs = {boolean.class} + ) + }) + public void _testSetReadOnly() { Statement st = null; try { conn.setReadOnly(true); @@ -443,6 +521,15 @@ public class ConnectionTest extends SQLTest { * * TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getHoldability", + methodArgs = {} + ) + }) public void testGetHoldability() { try { // conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT); @@ -461,6 +548,15 @@ public class ConnectionTest extends SQLTest { * * TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setHoldability", + methodArgs = {int.class} + ) + }) public void testSetHoldability() { Statement st = null; try { @@ -501,6 +597,15 @@ public class ConnectionTest extends SQLTest { * * TODO only Connection.TRANSACTION_SERIALIZABLE is supported */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getTransactionIsolation", + methodArgs = {} + ) + }) public void testGetTransactionIsolation() { try { // conn @@ -527,6 +632,15 @@ public class ConnectionTest extends SQLTest { * * TODO only Connection.TRANSACTION_SERIALIZABLE is supported */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "setTransactionIsolation", + methodArgs = {int.class} + ) + }) public void testSetTransactionIsolation() { try { // conn @@ -1045,6 +1159,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#commit() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "commit", + methodArgs = {} + ) + }) public void testCommit() { Statement st = null; Statement st1 = null; @@ -1123,6 +1246,15 @@ public class ConnectionTest extends SQLTest { /** * @test java.sql.Connection#rollback() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "rollback", + methodArgs = {} + ) + }) public void testRollback() { Statement st = null; Statement st1 = null; diff --git a/sql/src/test/java/tests/sql/PreparedStatementTest.java b/sql/src/test/java/tests/sql/PreparedStatementTest.java index 1e6b124..865a4c3 100755 --- a/sql/src/test/java/tests/sql/PreparedStatementTest.java +++ b/sql/src/test/java/tests/sql/PreparedStatementTest.java @@ -14,7 +14,12 @@ * limitations under the License. */ -package tests.sql; +package tests.sql; + +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; import java.math.BigDecimal; import java.sql.ParameterMetaData; @@ -31,6 +36,7 @@ import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; +@TestTargetClass(PreparedStatement.class) public class PreparedStatementTest extends SQLTest { String queryAllSelect = "select * from type"; @@ -103,6 +109,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#addBatch() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "addBatch", + methodArgs = {} + ) + }) public void testAddBatch() throws SQLException { PreparedStatement ps = null; try { @@ -364,7 +379,16 @@ public class PreparedStatementTest extends SQLTest { * it is possible to invoke the method getMetaData on a * PreparedStatement object rather than waiting to execute it. */ - public void testGetMetaData() { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getMetaData", + methodArgs = {} + ) + }) + public void _testGetMetaData() { PreparedStatement ps = null; try { String query = "update zoo set name='Masha', family='cat' where id=?;"; @@ -507,6 +531,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setInt(int parameterIndex, int x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setInt", + methodArgs = {int.class, int.class} + ) + }) public void testSetInt() throws SQLException { createTables(); PreparedStatement ps = null; @@ -577,6 +610,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setLong(int parameterIndex, long x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setLong", + methodArgs = {int.class, long.class} + ) + }) public void testSetLong() { createTables(); PreparedStatement ps = null; @@ -650,6 +692,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setFloat(int parameterIndex, float x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setFloat", + methodArgs = {int.class, float.class} + ) + }) public void testSetFloat() { float value1 = 12345678.12345689f; float value2 = -12345678.12345689f; @@ -720,6 +771,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setDouble(int parameterIndex, double x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setDouble", + methodArgs = {int.class, double.class} + ) + }) public void testSetDouble() { createTables(); PreparedStatement ps = null; @@ -791,6 +851,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setString(int parameterIndex, String x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setString", + methodArgs = {int.class, String.class} + ) + }) public void testSetString_charField() { createTables(); PreparedStatement ps = null; @@ -891,6 +960,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setString(int parameterIndex, String x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setString", + methodArgs = {int.class, String.class} + ) + }) public void testSetString_tinyTextField() { createTables(); PreparedStatement ps = null; @@ -993,6 +1071,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setString(int parameterIndex, String x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setString", + methodArgs = {int.class, String.class} + ) + }) public void testSetString_textField() { createTables(); PreparedStatement ps = null; @@ -1098,6 +1185,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setString(int parameterIndex, String x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setString", + methodArgs = {int.class, String.class} + ) + }) public void testSetString_mediumTextField() { createTables(); PreparedStatement ps = null; @@ -1191,6 +1287,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setString(int parameterIndex, String x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setString", + methodArgs = {int.class, String.class} + ) + }) public void testSetString_longTextField() { createTables(); PreparedStatement ps = null; @@ -1284,6 +1389,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setShort(int parameterIndex, short x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setShort", + methodArgs = {int.class, short.class} + ) + }) public void testSetShort() { createTables(); PreparedStatement ps = null; @@ -1382,6 +1496,15 @@ public class PreparedStatementTest extends SQLTest { * @test java.sql.PreparedStatement#setBoolean(int parameterIndex, boolean * x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setBoolean", + methodArgs = {int.class, boolean.class} + ) + }) public void testSetBoolean() { createTables(); PreparedStatement ps = null; @@ -1462,6 +1585,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setByte(int parameterIndex, byte x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setByte", + methodArgs = {int.class, byte.class} + ) + }) public void testSetByte() { createTables(); PreparedStatement ps = null; @@ -1542,6 +1674,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setBytes(int parameterIndex, byte[] x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setBytes", + methodArgs = {int.class, byte[].class} + ) + }) public void testSetBytes() { byte[] bytesArray = {1, 0}; @@ -1609,6 +1750,15 @@ public class PreparedStatementTest extends SQLTest { * @test java.sql.PreparedStatement#setBigDecimal(int parameterIndex, * BigDecimal x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setBigDecimal", + methodArgs = {int.class, BigDecimal.class} + ) + }) public void testSetBigDecimal() { BigDecimal bd = new BigDecimal("50"); @@ -1674,6 +1824,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setDate(int parameterIndex, Date x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setDate", + methodArgs = {int.class, Date.class} + ) + }) public void testSetDate_int_Date() { Date[] dates = { new Date(1799, 05, 26), new Date(Integer.MAX_VALUE), @@ -1747,6 +1906,15 @@ public class PreparedStatementTest extends SQLTest { * @test java.sql.PreparedStatement#setDate(int parameterIndex, Date x, * Calendar cal) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setDate", + methodArgs = {int.class, Date.class, Calendar.class} + ) + }) public void testSetDate_int_Date_Calendar() { Calendar[] cals = { Calendar.getInstance(), @@ -1825,6 +1993,15 @@ public class PreparedStatementTest extends SQLTest { * * this test doesn't passed on RI */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed in exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setNull", + methodArgs = {int.class, int.class} + ) + }) public void testSetNull_int_int() { createTables(); PreparedStatement ps = null; @@ -1938,6 +2115,15 @@ public class PreparedStatementTest extends SQLTest { * * this test doesn't pass on RI */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException case has incorrect structure", + targets = { + @TestTarget( + methodName = "setObject", + methodArgs = {int.class, Object.class} + ) + }) public void testSetObject_int_Object() { createTables(); PreparedStatement ps = null; @@ -2044,6 +2230,15 @@ public class PreparedStatementTest extends SQLTest { * * this test doesn't pass on RI */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "setObject", + methodArgs = {int.class, Object.class, int.class} + ) + }) public void testSetObject_int_Object_int() { createTables(); PreparedStatement ps = null; @@ -2150,6 +2345,15 @@ public class PreparedStatementTest extends SQLTest { * * this test doesn't pass on RI */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "setObject", + methodArgs = {int.class, Object.class, int.class, int.class} + ) + }) public void testSetObject_int_Object_int_int() { createTables(); PreparedStatement ps = null; @@ -2255,6 +2459,15 @@ public class PreparedStatementTest extends SQLTest { /** * @test java.sql.PreparedStatement#setTime(int parameterIndex, Time x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed from exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {int.class, Time.class} + ) + }) public void testSetTimeint_Time() { Time[] times = { new Time(24, 25, 26), new Time(Integer.MAX_VALUE), @@ -2327,6 +2540,15 @@ public class PreparedStatementTest extends SQLTest { * @test java.sql.PreparedStatement#setTime(int parameterIndex, Time x, * Calendar cal) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed from exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setTime", + methodArgs = {int.class, Time.class, Calendar.class} + ) + }) public void testSetTime_int_Time_Calendar() { Calendar[] cals = { Calendar.getInstance(), @@ -2403,6 +2625,15 @@ public class PreparedStatementTest extends SQLTest { * @test java.sql.PreparedStatement#setTimestamp(int parameterIndex, * Timestamp x) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "ps.execute() should be removed from exception part (for exception testing)", + targets = { + @TestTarget( + methodName = "setTimestamp", + methodArgs = {int.class, Timestamp.class} + ) + }) public void testSetTimestamp_int_Timestamp() { Timestamp[] timestamps = { new Timestamp(2007, 10, 17, 19, 06, 50, 23), diff --git a/sql/src/test/java/tests/sql/ResultSetMetaDataTest.java b/sql/src/test/java/tests/sql/ResultSetMetaDataTest.java index 1f9483b..4cd090f 100755 --- a/sql/src/test/java/tests/sql/ResultSetMetaDataTest.java +++ b/sql/src/test/java/tests/sql/ResultSetMetaDataTest.java @@ -16,12 +16,18 @@ package tests.sql; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; + import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; +@TestTargetClass(ResultSetMetaData.class) public class ResultSetMetaDataTest extends SQLTest { ResultSetMetaData rsmd = null; @@ -54,6 +60,16 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getCatalogName(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "1. SQLException checking missed. " + + "2. MAX/MIN/negative/valid parameters checking missed", + targets = { + @TestTarget( + methodName = "getCatalogName", + methodArgs = {int.class} + ) + }) public void testGetCatalogName() throws SQLException { try { assertNull(rsmd.getCatalogName(0)); @@ -65,6 +81,16 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnClassName(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "1. SQLException checking missed. " + + "2. MAX/MIN/zero parameters checking missed", + targets = { + @TestTarget( + methodName = "getColumnClassName", + methodArgs = {int.class} + ) + }) public void testGetColumnClassName() { try { assertNotNull(rsmd); @@ -93,6 +119,15 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnCount() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getColumnCount", + methodArgs = {} + ) + }) public void testGetColumnCount() { try { assertEquals(3, rsmd.getColumnCount()); @@ -104,6 +139,16 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnLabel(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "1. SQLException checking missed. " + + "2. MAX/MIN/negative/zero parameters checking missed", + targets = { + @TestTarget( + methodName = "getColumnLabel", + methodArgs = {int.class} + ) + }) public void testGetColumnLabel() { String[] labels = { "zoo.id", "zoo.name", "zoo.family" }; try { @@ -119,6 +164,15 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnName(int column) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "getColumnLable was tested instead of getColumnName", + targets = { + @TestTarget( + methodName = "getColumnName", + methodArgs = {int.class} + ) + }) public void testGetColumnName() { String[] labels = { "zoo.id", "zoo.name", "zoo.family" }; try { @@ -148,6 +202,15 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnType(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "MAX/MIN/zero parameters checking missed", + targets = { + @TestTarget( + methodName = "getColumnType", + methodArgs = {int.class} + ) + }) public void testGetColumnType() { int[] types = { Types.SMALLINT, Types.VARCHAR, Types.VARCHAR}; try { @@ -176,6 +239,15 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getColumnTypeName(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "MAX/MIN/zero parameters checking missed", + targets = { + @TestTarget( + methodName = "getColumnTypeName", + methodArgs = {int.class} + ) + }) public void testGetColumnTypeName() { try { assertEquals("smallint", rsmd.getColumnTypeName(1)); @@ -202,6 +274,15 @@ public class ResultSetMetaDataTest extends SQLTest { /** * @test java.sql.ResultSetMetaData#getTableName(int column) */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "MAX/MIN/zero parameters checking missed", + targets = { + @TestTarget( + methodName = "getTableName", + methodArgs = {int.class} + ) + }) public void testGetTableName() { try { assertEquals("zoo", rsmd.getTableName(1)); diff --git a/sql/src/test/java/tests/sql/SQLTest.java b/sql/src/test/java/tests/sql/SQLTest.java index 08ae350..4bc4af6 100755 --- a/sql/src/test/java/tests/sql/SQLTest.java +++ b/sql/src/test/java/tests/sql/SQLTest.java @@ -16,6 +16,8 @@ package tests.sql; +import dalvik.annotation.TestTargetClass; + import java.io.File; import java.sql.Connection; import java.sql.DriverManager; @@ -30,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +@TestTargetClass(Statement.class) public class SQLTest extends TestCase { static Connection conn; diff --git a/sql/src/test/java/tests/sql/StatementTest.java b/sql/src/test/java/tests/sql/StatementTest.java index fd1002e..54561fa 100755 --- a/sql/src/test/java/tests/sql/StatementTest.java +++ b/sql/src/test/java/tests/sql/StatementTest.java @@ -14,7 +14,12 @@ * limitations under the License. */ -package tests.sql; +package tests.sql; + +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; import java.sql.BatchUpdateException; import java.sql.ResultSet; @@ -23,11 +28,21 @@ import java.sql.SQLWarning; import java.sql.Statement; import java.util.Vector; +@TestTargetClass(Statement.class) public class StatementTest extends SQLTest { /** * @test java.sql.Statement#addBatch(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "addBatch", + methodArgs = {String.class} + ) + }) public void testAddBatch() throws SQLException { Statement st = null; @@ -81,6 +96,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#clearWarnings() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "clearWarnings", + methodArgs = {} + ) + }) public void testClearWarnings() { Statement st = null; try { @@ -159,6 +183,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#clearBatch(String) */ + @TestInfo( + level = TestLevel.TODO, + purpose = "addBatch tested instead of clearBatch method", + targets = { + @TestTarget( + methodName = "clearBatch", + methodArgs = {} + ) + }) public void testClearBatch() throws SQLException { Statement st = null; @@ -216,6 +249,15 @@ public class StatementTest extends SQLTest { * TODO not pass on SQLite and RI. * */ + @TestInfo( + level = TestLevel.PARTIAL_OK, + purpose = "", + targets = { + @TestTarget( + methodName = "execute", + methodArgs = {String.class} + ) + }) public void testExecute() throws SQLException { String[] queries = { @@ -306,6 +348,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#getConnection() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getConnection", + methodArgs = {} + ) + }) public void testGetConnection() { Statement st = null; try { @@ -324,6 +375,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#getFetchDirection() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getFetchDirection", + methodArgs = {} + ) + }) public void testGetFetchDirection() { Statement st = null; try { @@ -387,6 +447,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#getFetchSize() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getFetchSize", + methodArgs = {} + ) + }) public void testGetFetchSize() { Statement st = null; try { @@ -560,7 +629,16 @@ public class StatementTest extends SQLTest { * @test java.sql.Statement#close() * TODO not passed but according to Java Docs */ - public void testClose() { + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "close", + methodArgs = {} + ) + }) + public void _testClose() { Statement st = null; try { String[] queries = { @@ -657,6 +735,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#executeBatch() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException, BatchUpdateException checking missed", + targets = { + @TestTarget( + methodName = "executeBatch", + methodArgs = {} + ) + }) public void testExecuteBatch() { String[] queries = { @@ -706,7 +793,16 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#executeQuery(String sql) */ - public void testExecuteQuery_String() { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Null/empty parameter checking missed", + targets = { + @TestTarget( + methodName = "executeQuery", + methodArgs = {String.class} + ) + }) + public void _testExecuteQuery_String() { String[] queries1 = { "select * from zoo", "select name, family from zoo where id = 1" }; @@ -765,7 +861,16 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#executeUpdate(String sql) */ - public void testExecuteUpdate_String() { + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Null/empty parameter checking missed", + targets = { + @TestTarget( + methodName = "executeUpdate", + methodArgs = {String.class} + ) + }) + public void _testExecuteUpdate_String() { String[] queries1 = { "update zoo set name='Masha', family='cat' where id=2;", @@ -932,6 +1037,15 @@ public class StatementTest extends SQLTest { /** * @test java.sql.Statement#getUpdateCount() */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "SQLException checking missed", + targets = { + @TestTarget( + methodName = "getUpdateCount", + methodArgs = {} + ) + }) public void testGetUpdateCount() { Statement st = null; try { |