From 6934615b9736d0a777ce7f6933129ea1cdd2dd23 Mon Sep 17 00:00:00 2001 From: Warren Levy Date: Fri, 1 Dec 2000 01:48:34 +0000 Subject: Array.java: New file from classpath. * Array.java: New file from classpath. * BatchUpdateException.java: Ditto. * Blob.java: Ditto. * Clob.java: Ditto. * Ref.java: Ditto. * SQLData.java: Ditto. * SQLInput.java: Ditto. * SQLOutput.java: Ditto. * Struct.java: Ditto. * CallableStatement.java: Merged file from claspath. * Connection.java: Ditto. * DataTruncation.java: Ditto. * DatabaseMetaData.java: Ditto. * DriverManager.java: Ditto. * PreparedStatement.java: Ditto. * ResultSet.java: Ditto. * ResultSetMetaData.java: Ditto. * SQLException.java: Ditto. * SQLWarning.java: Ditto. * Statement.java: Ditto. * Types.java: Ditto. From-SVN: r37906 --- libjava/java/sql/Connection.java | 111 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 5 deletions(-) (limited to 'libjava/java/sql/Connection.java') diff --git a/libjava/java/sql/Connection.java b/libjava/java/sql/Connection.java index bb826a67e66..8d986aa1b9d 100644 --- a/libjava/java/sql/Connection.java +++ b/libjava/java/sql/Connection.java @@ -27,6 +27,8 @@ executable file might be covered by the GNU General Public License. */ package java.sql; +import java.util.Map; + /** * This interface provides methods for managing a connection to a database. * @@ -91,6 +93,28 @@ createStatement() throws SQLException; /*************************************************************************/ +/** + * This method creates a new SQL statement with the specified type and + * concurrency. Valid values for these parameters are specified in the + * ResultSet class. + * + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * + * @return A new Statement object. + * + * @exception SQLException If an error occurs. + * + * @see Statement + * @see ResultSet + */ +public abstract Statement +createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException; + +/*************************************************************************/ + /** * This method creates a new PreparedStatement for the specified * SQL string. This method is designed for use with parameterized @@ -110,6 +134,32 @@ prepareStatement(String sql) throws SQLException; /*************************************************************************/ +/** + * This method creates a new PreparedStatement for the specified + * SQL string. This method is designed for use with parameterized + * statements. The specified result set type and concurrency will be used. + * Valid values for these parameters are specified in the + * ResultSet class. + * + * @param The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * + * @return A new PreparedStatement. + * + * @exception SQLException If an error occurs. + * + * @see PreparedStatement + * @see ResultSet + */ +public abstract PreparedStatement +prepareStatement(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException; + +/*************************************************************************/ + /** * This method creates a new CallableStatement for the * specified SQL string. Thie method is designed to be used with @@ -130,6 +180,32 @@ prepareCall(String sql) throws SQLException; /*************************************************************************/ +/** + * This method creates a new CallableStatement for the + * specified SQL string. Thie method is designed to be used with + * stored procedures. The specified result set type and concurrency + * will be used. Valid values for these parameters are specified in the + * ResultSet class. + * + * @param The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency. The type of concurrency to be used in + * the result set for this statement. + * + * @return A new CallableStatement. + * + * @exception SQLException If an error occurs. + * + * @see CallableStatement + * @see ResultSet + */ +public abstract CallableStatement +prepareCall(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException; + +/*************************************************************************/ + /** * This method converts the specified generic SQL statement into the * native grammer of the database this object is connected to. @@ -309,12 +385,10 @@ getTransactionIsolation() throws SQLException; /*************************************************************************/ /** - * This method sets the transaction isolation level using one of the - * constants defined in this interface. + * This method sets the current transaction isolation mode. This must + * be one of the constants defined in this interface. * - * @param level The transaction isolation level to change to; must be - * one of the TRANSACTION_* isolation values with the exception of - * TRANSACTION_NONE; some databases may not support other values. + * @param level The transaction isolation level. * * @exception SQLException If an error occurs. */ @@ -346,5 +420,32 @@ getWarnings() throws SQLException; public abstract void clearWarnings() throws SQLException; +/*************************************************************************/ + +/** + * This method returns the mapping of SQL types to Java classes + * currently in use by this connection. This mapping will have no + * entries unless they have been manually added. + * + * @return The SQL type to Java class mapping. + * + * @exception SQLException If an error occurs. + */ +public abstract Map +getTypeMap() throws SQLException; + +/*************************************************************************/ + +/** + * This method sets the mapping table for SQL types to Java classes. + * Any entries in this map override the defaults. + * + * @param map The new SQL mapping table. + * + * @exception SQLException If an error occurs. + */ +public abstract void +setTypeMap(Map map) throws SQLException; + } // interface Connection -- cgit v1.2.3