com.sas.net.sharenet
Class ShareNetConnection

java.lang.Object
  |
  +--com.sas.net.sharenet.ShareNetConnection
All Implemented Interfaces:

public class ShareNetConnection
extends Object
implements java.sql.Connection

This class establishes a session with a SAS/SHARE server.


Field Summary
 SQLWarning warnings
           
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
 
Method Summary
 void clearWarnings()
          Removes all warnings that are associated with this object.
 void close()
          Closes all the ShareNetStatement and ShareNetPreparedStatement objects that are associated with this object and closes the connection to the server.
 void commit()
          Closes all the open Statement and PreparedStatement objects that are associated with this object.
 Statement createStatement()
          Creates a ShareNetStatement object.
 Statement createStatement(int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a Statement object by allowing the default result set type and result set concurrency type to be overridden.
 Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 boolean getAutoCommit()
          SAS software does not support transactions.
 String getCatalog()
          SAS software does not support SQL catalogs.
 int getHoldability()
          Retrieves the current holdability of ResultSet objects created using this Connection object.
 DatabaseMetaData getMetaData()
          Creates a ShareNetDatabaseMetaData object.
 int getTransactionIsolation()
          SAS software does not support transactions.
 Map getTypeMap()
          JDBC 2.0   * Gets the type-map object associated with this connection as a java.util.Map object
 SQLWarning getWarnings()
          Returns the warnings associated with this object.
 boolean isClosed()
          Indicates whether the connection to the server is closed.
 boolean isReadOnly()
          SAS software does not support read-only connections.
 String nativeSQL(String sql)
          Returns the input string.
 CallableStatement prepareCall(String sql)
          Creates a ShareNetCallableStatement object.
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a CallableStatement object by allowing the default result set type and result set concurrency type to be overridden.
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a CallableStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 PreparedStatement prepareStatement(String sql)
          Creates a ShareNetPreparedStatement object.
 PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
          Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.
 PreparedStatement prepareStatement(String sql, int[] columnIndexes)
          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
          JDBC 2.0 Creates a PreparedStatement object by allowing the default result set type and result set concurrency type to be overridden.
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 PreparedStatement prepareStatement(String sql, String[] columnNames)
          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 void releaseSavepoint(Savepoint savepoint)
          Removes the given Savepoint object from the current transaction.
 void rollback()
          SAS software does not support transactions.
 void rollback(Savepoint savepoint)
          Undoes all changes made after the given Savepoint object was set.
 void setAutoCommit(boolean autoCommit)
          Sets the auto-commit state.
 void setCatalog(String catalog)
          SAS software does not support SQL catalogs.
 void setHoldability(int holdability)
          Changes the holdability of ResultSet objects created using this Connection object to the given holdability.
 void setReadOnly(boolean readOnly)
          SAS software does not support read-only connections.
 Savepoint setSavepoint()
          Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
 Savepoint setSavepoint(String name)
          Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.
 void setTransactionIsolation(int level)
          SAS software does not support transactions.
 void setTypeMap(Map map)
          JDBC 2.0  * Sets a type-map object as the default type-map for  * this connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


warnings

public SQLWarning warnings
Constructor Detail
Method Detail

createStatement

public Statement createStatement()
                          throws SQLException
Creates a ShareNetStatement object.
Specified by:
createStatement in interface Connection
Returns:
A new ShareNetStatement object.
Throws:
SQLException - This exception is thrown if a ShareNetStatement object cannot be created.

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
Creates a ShareNetPreparedStatement object.
Specified by:
prepareStatement in interface Connection
Parameters:
sql - An input SQL string.
Returns:
A new ShareNetPreparedStatement object.
Throws:
SQLException - This exception is thrown if a ShareNetPreparedStatement cannot be created.

prepareCall

public CallableStatement prepareCall(String sql)
                              throws SQLException
Creates a ShareNetCallableStatement object.
Specified by:
prepareCall in interface Connection
Parameters:
sql - An input SQL string.
Returns:
A new ShareNetCallableStatement object.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

nativeSQL

public String nativeSQL(String sql)
                 throws SQLException
Returns the input string. The SQL is not optimized.
Specified by:
nativeSQL in interface Connection
Parameters:
sql - An input SQL string for optimization.
Returns:
An input string.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws SQLException
Sets the auto-commit state.
Specified by:
setAutoCommit in interface Connection
Parameters:
autoCommit - This value must be True. SAS software does not support transactions.
Throws:
SQLException - This exception is thrown if the value for autoCommit is False.

getAutoCommit

public boolean getAutoCommit()
                      throws SQLException
SAS software does not support transactions. All statements are committed individually. The current auto-commit state is always True.
Specified by:
getAutoCommit in interface Connection
Returns:
True.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

commit

public void commit()
            throws SQLException
Closes all the open Statement and PreparedStatement objects that are associated with this object.
Specified by:
commit in interface Connection
Throws:
SQLException - This exception is thrown if an exception occurred while outstanding statements were being closed.

rollback

public void rollback()
              throws SQLException
SAS software does not support transactions. This method is not supported.
Specified by:
rollback in interface Connection
Throws:
SQLException - This exception is always thrown.

close

public void close()
           throws SQLException
Closes all the ShareNetStatement and ShareNetPreparedStatement objects that are associated with this object and closes the connection to the server.
Specified by:
close in interface Connection
Throws:
SQLException - This exception is thrown if a ShareNetException is detected.

isClosed

public boolean isClosed()
                 throws SQLException
Indicates whether the connection to the server is closed.
Specified by:
isClosed in interface Connection
Returns:
A Boolean that indicates whether the connection to the server is open (False) or closed (True).
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

getMetaData

public DatabaseMetaData getMetaData()
                             throws SQLException
Creates a ShareNetDatabaseMetaData object. This class will only create DatabaseMetaData objects for connections to SQLVIEW databases. DatabaseMetaData objects will not be created for other databases such as Oracle databases.
Specified by:
getMetaData in interface Connection
Returns:
A ShareNetDatabaseMetaData object.
Throws:
SQLException - This exception is thrown if a ShareNetDatabaseMetaData object cannot be created.

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws SQLException
SAS software does not support read-only connections. The input value is ignored.
Specified by:
setReadOnly in interface Connection
Parameters:
readOnly - This parameter is ignored.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

isReadOnly

public boolean isReadOnly()
                   throws SQLException
SAS software does not support read-only connections. The readOnly value is always False.
Specified by:
isReadOnly in interface Connection
Returns:
False.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

setCatalog

public void setCatalog(String catalog)
                throws SQLException
SAS software does not support SQL catalogs. The input parameter is ignored.
Specified by:
setCatalog in interface Connection
Parameters:
catalog - This parameter is ignored.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

getCatalog

public final String getCatalog()
                        throws SQLException
SAS software does not support SQL catalogs. This method always returns a NULL.
Specified by:
getCatalog in interface Connection
Returns:
A NULL.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws SQLException
SAS software does not support transactions. The only valid input value is java.sql.Connection.TRANSACTION_NONE.
Specified by:
setTransactionIsolation in interface Connection
Parameters:
level - The transaction level.
Throws:
SQLException - This exception is thrown if the value of level is not valid.

getTransactionIsolation

public int getTransactionIsolation()
                            throws SQLException
SAS software does not support transactions.
Specified by:
getTransactionIsolation in interface Connection
Returns:
java.sql.Connection.TRANSACTION_NONE.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Returns the warnings associated with this object.
Specified by:
getWarnings in interface Connection
Returns:
SqlWarning warnings.
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

clearWarnings

public void clearWarnings()
                   throws SQLException
Removes all warnings that are associated with this object.
Specified by:
clearWarnings in interface Connection
Throws:
SQLException - This exception is required by the interface, but it is never thrown.

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency)
                          throws SQLException
JDBC 2.0 Creates a Statement object by allowing the default result set type and result set concurrency type to be overridden. Currently, you cannot override the default result set types and concurrency types. We support only TYPE_FORWARD_ONLY result type and CONCUR_READ_ONLY result set concurrency type.
Specified by:
createStatement in interface Connection
Parameters:
resultSetType - The result set type TYPE_FORWARD_ONLY.
resultSetConcurrency - The concurrency type CONCUR_READ_ONLY.
Returns:
A new Statement object.
Throws:
SQLException - This exception is thrown if a Statement object cannot be created.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException
JDBC 2.0 Creates a PreparedStatement object by allowing the default result set type and result set concurrency type to be overridden. Currently, you cannot override the default result set types and concurrency types. We support only TYPE_FORWARD_ONLY result type and CONCUR_READ_ONLY result set concurrency type.
Specified by:
prepareStatement in interface Connection
Parameters:
sql - The SQL statement String.
resultSetType - The result set type TYPE_FORWARD_ONLY.
resultSetConcurrency - The concurrency type CONCUR_READ_ONLY.
Returns:
A new PreparedStatement object containing the pre-compiled SQL statement.
Throws:
SQLException - This exception is thrown if a PreparedStatement object cannot be created.

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency)
                              throws SQLException
JDBC 2.0 Creates a CallableStatement object by allowing the default result set type and result set concurrency type to be overridden. Currently, you cannot override the default result set types and concurrency types. We support only TYPE_FORWARD_ONLY result type and CONCUR_READ_ONLY result set concurrency type.
Specified by:
prepareCall in interface Connection
Parameters:
sql - The SQL statement String.
resultSetType - The result set type TYPE_FORWARD_ONLY.
resultSetConcurrency - The concurrency type CONCUR_READ_ONLY.
Returns:
A new CallableStatement object containing the pre-compiled SQL statement.
Throws:
SQLException - This exception is thrown if a CallableStatement object cannot be created.

getTypeMap

public Map getTypeMap()
               throws SQLException
JDBC 2.0   * Gets the type-map object associated with this connection as a java.util.Map object.   * By default, the map returned is empty. This method is not yet supported.
Specified by:
getTypeMap in interface Connection
Returns:
The type-map object associated with this connection.
Throws:
SQLException - This exception is always thrown.  

setTypeMap

public void setTypeMap(Map map)
                throws SQLException
JDBC 2.0  * Sets a type-map object as the default type-map for  * this connection. This method is not yet supported.
Specified by:
setTypeMap in interface Connection
Parameters:
map - A type-map object to be associated with this connection.
Throws:
SQLException - This exception is always thrown.  

setHoldability

public void setHoldability(int holdability)
                    throws SQLException
Changes the holdability of ResultSet objects created using this Connection object to the given holdability. This method is not implemented.
Specified by:
setHoldability in interface Connection
Throws:
SQLException - This exception is always thrown.

getHoldability

public int getHoldability()
                   throws SQLException
Retrieves the current holdability of ResultSet objects created using this Connection object. This method is not implemented.
Specified by:
getHoldability in interface Connection
Throws:
SQLException - This exception is always thrown.

setSavepoint

public Savepoint setSavepoint()
                       throws SQLException
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. This method is not implemented.
Specified by:
setSavepoint in interface Connection
Throws:
SQLException - This exception is always thrown.

setSavepoint

public Savepoint setSavepoint(String name)
                       throws SQLException
Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it. This method is not implemented.
Specified by:
setSavepoint in interface Connection
Throws:
SQLException - This exception is always thrown.

rollback

public void rollback(Savepoint savepoint)
              throws SQLException
Undoes all changes made after the given Savepoint object was set. This method is not implemented.
Specified by:
rollback in interface Connection
Throws:
SQLException - This exception is always thrown.

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)
                      throws SQLException
Removes the given Savepoint object from the current transaction. This method is not implemented.
Specified by:
releaseSavepoint in interface Connection
Throws:
SQLException - This exception is always thrown.

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency,
                                 int resultSetHoldability)
                          throws SQLException
Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is not implemented.
Specified by:
createStatement in interface Connection
Throws:
SQLException - This exception is always thrown.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws SQLException
Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is not implemented.
Specified by:
prepareStatement in interface Connection
Throws:
SQLException - This exception is always thrown.

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
                              throws SQLException
Creates a CallableStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is not implemented.
Specified by:
prepareCall in interface Connection
Throws:
SQLException - This exception is always thrown.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int autoGeneratedKeys)
                                   throws SQLException
Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. This method is not implemented.
Specified by:
prepareStatement in interface Connection
Throws:
SQLException - This exception is always thrown.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int[] columnIndexes)
                                   throws SQLException
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This method is not implemented.
Specified by:
prepareStatement in interface Connection
Throws:
SQLException - This exception is always thrown.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          String[] columnNames)
                                   throws SQLException
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. This method is not implemented.
Specified by:
prepareStatement in interface Connection
Throws:
SQLException - This exception is always thrown.



Copyright © 2003 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 09 Jul 2004 16:13:37