com.sas.net.sharenet
Class ShareNetConnection

com.sas.net.sharenet.ShareNetConnection
All Implemented Interfaces:
java.sql.Connection, java.sql.Wrapper

public class ShareNetConnection
implements java.sql.Connection

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


Field Summary
protected  com.sas.net.sharenet.Wqecon con
           
protected  com.sas.net.sharenet.Defdestroy defdes
           
protected  com.sas.net.sharenet.Tcpmsg msg
           
protected  int resultSetConcurrency
           
protected  int resultSetType
           
protected  int sharenetType
           
protected  java.lang.String version_msg
           
 java.sql.SQLWarning warnings
           
protected  com.sas.net.sharenet.Xherscon xher1
           
 
Constructor Summary
ShareNetConnection(java.lang.String host, int port, java.util.Properties info, com.sas.net.sharenet.Wqecon con)
          Constructs a ShareNetConnection object.
ShareNetConnection(java.lang.String url, java.util.Properties info)
          Constructs a ShareNetConnection object.
 
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.
protected  void connect(java.lang.String myhost, int port)
          Connect to the server.
 java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements)
          This method is not supported.
 java.sql.Blob createBlob()
          This method is not supported.
 java.sql.Clob createClob()
          This method is not supported.
 java.sql.NClob createNClob()
          This method is not supported.
 java.sql.SQLXML createSQLXML()
          This method is not supported.
 java.sql.Statement createStatement()
          Creates a ShareNetStatement object.
 java.sql.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.
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes)
          This method is not supported.
protected  void deleteStatement(java.lang.Object statement)
          Protected method which deletes statements associated with this object.
protected  int execute(java.lang.String command)
          Execute a command on the remote server.
protected  void finalize()
          Protected method which cleans up state associated with this object.
protected static java.lang.String formatMsg(int acc, com.sas.net.sharenet.Ans1 ans1, com.sas.net.sharenet.Rcmsg rcmsg)
          Format the response from the server.
 boolean getAutoCommit()
          SAS software does not support transactions.
 java.lang.String getCatalog()
          SAS software does not support SQL catalogs.
 java.util.Properties getClientInfo()
          This method is not supported.
 java.lang.String getClientInfo(java.lang.String name)
          This method is not supported.
 int getHoldability()
          Retrieves the current holdability of ResultSet objects created using this Connection object.
 java.sql.DatabaseMetaData getMetaData()
          Creates a ShareNetDatabaseMetaData object.
protected  boolean getRemarks()
          Protected method
 int getTransactionIsolation()
          SAS software does not support transactions.
 java.util.Map getTypeMap()
          JDBC 2.0 Gets the type-map object associated with this connection as a java.util.Map object.
protected  java.lang.String getUrl()
          Protected method
protected  java.lang.String getUser()
          Protected method
 java.sql.SQLWarning getWarnings()
          Returns the warnings associated with this object.
 boolean isClosed()
          Indicates whether the connection to the server is closed.
protected  boolean isConnected()
          Gets the state of the connection.
 boolean isReadOnly()
          SAS software does not support read-only connections.
 boolean isValid(int timeout)
          This method is not supported.
 boolean isWrapperFor(java.lang.Class<?> iface)
          This method is not supported.
 java.lang.String nativeSQL(java.lang.String sql)
          Returns the input string.
 java.sql.CallableStatement prepareCall(java.lang.String sql)
          Creates a ShareNetCallableStatement object.
 java.sql.CallableStatement prepareCall(java.lang.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.
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a CallableStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
          Creates a ShareNetPreparedStatement object.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys)
          Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes)
          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 java.sql.PreparedStatement prepareStatement(java.lang.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.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames)
          Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
 void releaseSavepoint(java.sql.Savepoint savepoint)
          Removes the given Savepoint object from the current transaction.
 void rollback()
          SAS software does not support transactions.
 void rollback(java.sql.Savepoint savepoint)
          Undoes all changes made after the given Savepoint object was set.
 void setAutoCommit(boolean autoCommit)
          Sets the auto-commit state.
 void setCatalog(java.lang.String catalog)
          SAS software does not support SQL catalogs.
 void setClientInfo(java.util.Properties properties)
          This method is not supported.
 void setClientInfo(java.lang.String name, java.lang.String value)
          This method is not supported.
 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.
 java.sql.Savepoint setSavepoint()
          Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
 java.sql.Savepoint setSavepoint(java.lang.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(java.util.Map map)
          JDBC 2.0 Sets a type-map object as the default type-map for this connection.
<T> T
unwrap(java.lang.Class<T> iface)
          This method is not supported.
 

Field Detail

warnings

public java.sql.SQLWarning warnings

con

protected com.sas.net.sharenet.Wqecon con

xher1

protected com.sas.net.sharenet.Xherscon xher1

defdes

protected com.sas.net.sharenet.Defdestroy defdes

msg

protected com.sas.net.sharenet.Tcpmsg msg

sharenetType

protected int sharenetType

version_msg

protected java.lang.String version_msg

resultSetType

protected int resultSetType

resultSetConcurrency

protected int resultSetConcurrency
Constructor Detail

ShareNetConnection

public ShareNetConnection(java.lang.String url,
                          java.util.Properties info)
                   throws java.sql.SQLException
Constructs a ShareNetConnection object.

Parameters:
url - initial input url
info - java.util.Properties object which contains properties needed to obtain a connection.
Throws:
java.sql.SQLException - This exception is thrown if a ShareNetException is detected.
See Also:
ShareNetDriver.connect

ShareNetConnection

public ShareNetConnection(java.lang.String host,
                          int port,
                          java.util.Properties info,
                          com.sas.net.sharenet.Wqecon con)
                   throws java.sql.SQLException
Constructs a ShareNetConnection object.

Throws:
java.sql.SQLException - This exception is thrown if a ShareNetException is detected.
Method Detail

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Creates a ShareNetStatement object.

Specified by:
createStatement in interface java.sql.Connection
Returns:
A new ShareNetStatement object.
Throws:
java.sql.SQLException - This exception is thrown if a ShareNetStatement object cannot be created.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Creates a ShareNetPreparedStatement object.

Specified by:
prepareStatement in interface java.sql.Connection
Parameters:
sql - An input SQL string.
Returns:
A new ShareNetPreparedStatement object.
Throws:
java.sql.SQLException - This exception is thrown if a ShareNetPreparedStatement cannot be created.

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
Creates a ShareNetCallableStatement object.

Specified by:
prepareCall in interface java.sql.Connection
Parameters:
sql - An input SQL string.
Returns:
A new ShareNetCallableStatement object.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException
Returns the input string. The SQL is not optimized.

Specified by:
nativeSQL in interface java.sql.Connection
Parameters:
sql - An input SQL string for optimization.
Returns:
An input string.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException
Sets the auto-commit state.

Specified by:
setAutoCommit in interface java.sql.Connection
Parameters:
autoCommit - This value must be True. SAS software does not support transactions.
Throws:
java.sql.SQLException - This exception is thrown if the value for autoCommit is False.

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.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 java.sql.Connection
Returns:
True.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

commit

public void commit()
            throws java.sql.SQLException
Closes all the open Statement and PreparedStatement objects that are associated with this object.

Specified by:
commit in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is thrown if an exception occurred while outstanding statements were being closed.

rollback

public void rollback()
              throws java.sql.SQLException
SAS software does not support transactions. This method is not supported.

Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

close

public void close()
           throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is thrown if a ShareNetException is detected.

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Indicates whether the connection to the server is closed.

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

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.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 java.sql.Connection
Returns:
A ShareNetDatabaseMetaData object.
Throws:
java.sql.SQLException - This exception is thrown if a ShareNetDatabaseMetaData object cannot be created.

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws java.sql.SQLException
SAS software does not support read-only connections. The input value is ignored.

Specified by:
setReadOnly in interface java.sql.Connection
Parameters:
readOnly - This parameter is ignored.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
SAS software does not support read-only connections. The readOnly value is always False.

Specified by:
isReadOnly in interface java.sql.Connection
Returns:
False.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

setCatalog

public void setCatalog(java.lang.String catalog)
                throws java.sql.SQLException
SAS software does not support SQL catalogs. The input parameter is ignored.

Specified by:
setCatalog in interface java.sql.Connection
Parameters:
catalog - This parameter is ignored.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

getCatalog

public final java.lang.String getCatalog()
                                  throws java.sql.SQLException
SAS software does not support SQL catalogs. This method always returns a NULL.

Specified by:
getCatalog in interface java.sql.Connection
Returns:
A NULL.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException
SAS software does not support transactions. The only valid input value is java.sql.Connection.TRANSACTION_NONE.

Specified by:
setTransactionIsolation in interface java.sql.Connection
Parameters:
level - The transaction level.
Throws:
java.sql.SQLException - This exception is thrown if the value of level is not valid.

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
SAS software does not support transactions.

Specified by:
getTransactionIsolation in interface java.sql.Connection
Returns:
java.sql.Connection.TRANSACTION_NONE.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Returns the warnings associated with this object.

Specified by:
getWarnings in interface java.sql.Connection
Returns:
SqlWarning warnings.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Removes all warnings that are associated with this object.

Specified by:
clearWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.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 java.sql.Connection
Parameters:
resultSetType - The result set type TYPE_FORWARD_ONLY.
resultSetConcurrency - The concurrency type CONCUR_READ_ONLY.
Returns:
A new Statement object.
Throws:
java.sql.SQLException - This exception is thrown if a Statement object cannot be created.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.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 java.sql.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:
java.sql.SQLException - This exception is thrown if a PreparedStatement object cannot be created.

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.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 java.sql.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:
java.sql.SQLException - This exception is thrown if a CallableStatement object cannot be created.

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.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 java.sql.Connection
Returns:
The type-map object associated with this connection.
Throws:
java.sql.SQLException - This exception is always thrown.

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.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 java.sql.Connection
Parameters:
map - A type-map object to be associated with this connection.
Throws:
java.sql.SQLException - This exception is always thrown.

setHoldability

public void setHoldability(int holdability)
                    throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Retrieves the current holdability of ResultSet objects created using this Connection object. This method is not implemented.

Specified by:
getHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException
Undoes all changes made after the given Savepoint object was set. This method is not implemented.

Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException
Removes the given Savepoint object from the current transaction. This method is not implemented.

Specified by:
releaseSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)
                                            throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] columnIndexes)
                                            throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.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 java.sql.Connection
Throws:
java.sql.SQLException - This exception is always thrown.

deleteStatement

protected void deleteStatement(java.lang.Object statement)
Protected method which deletes statements associated with this object. Called by the statement's close method.

Parameters:
statement - statement object to be removed from the statementList

getUser

protected java.lang.String getUser()
Protected method

Returns:
String username associated with this object

getUrl

protected java.lang.String getUrl()
Protected method

Returns:
String url associated with this object

getRemarks

protected boolean getRemarks()
Protected method

Returns:
boolean remarks

finalize

protected void finalize()
                 throws java.lang.Throwable
Protected method which cleans up state associated with this object.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Exception - Throwable is required, but it is never thrown.
java.lang.Throwable

connect

protected void connect(java.lang.String myhost,
                       int port)
                throws ShareNetException
Connect to the server.

Parameters:
host - host machine name
port - TCP/IP port number
Throws:
ShareNetException - if an IOException is detected

execute

protected int execute(java.lang.String command)
               throws ShareNetException
Execute a command on the remote server. Typically, this is used to define new data sets.

Parameters:
command - command
Returns:
count number of records updated
Throws:
ShareNetException - if an IOException is detected

isConnected

protected boolean isConnected()
Gets the state of the connection.

Returns:
connected A boolean value indicating the state of the connection.

formatMsg

protected static java.lang.String formatMsg(int acc,
                                            com.sas.net.sharenet.Ans1 ans1,
                                            com.sas.net.sharenet.Rcmsg rcmsg)
                                     throws ShareNetException
Format the response from the server.

Parameters:
acc - response code from server
ans1 - answer segment one from the server
rcmsg - response message from the server
Throws:
ShareNetException - if an IOException is detected

createClob

public java.sql.Clob createClob()
                         throws java.sql.SQLException
This method is not supported.

Constructs an object that implements the Clob interface. The object returned initially contains no data. The setAsciiStream, setCharacterStream and setString methods of the Clob interface may be used to add data to the Clob.

Specified by:
createClob in interface java.sql.Connection
Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

createBlob

public java.sql.Blob createBlob()
                         throws java.sql.SQLException
This method is not supported.

Constructs an object that implements the Blob interface. The object returned initially contains no data. The setBinaryStream and setBytes methods of the Blob interface may be used to add data to the Blob.

Specified by:
createBlob in interface java.sql.Connection
Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

createNClob

public java.sql.NClob createNClob()
                           throws java.sql.SQLException
This method is not supported.

Constructs an object that implements the NClob interface. The object returned initially contains no data. The setAsciiStream, setCharacterStream and setString methods of the NClob interface may be used to add data to the NClob.

Specified by:
createNClob in interface java.sql.Connection
Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

createSQLXML

public java.sql.SQLXML createSQLXML()
                             throws java.sql.SQLException
This method is not supported.

Constructs an object that implements the SQLXML interface. The object returned initially contains no data. The createXmlStreamWriter object and setString method of the SQLXML interface may be used to add data to the SQLXML object.

Specified by:
createSQLXML in interface java.sql.Connection
Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

isValid

public boolean isValid(int timeout)
                throws java.sql.SQLException
This method is not supported.

Returns true if the connection has not been closed and is still valid. The driver shall submit a query on the connection or use some other mechanism that positively verifies the connection is still valid when this method is called.

The query submitted by the driver to validate the connection shall be executed in the context of the current transaction.

Specified by:
isValid in interface java.sql.Connection
Parameters:
timeout - - The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

See Also:
DatabaseMetaData.getClientInfoProperties()

setClientInfo

public void setClientInfo(java.lang.String name,
                          java.lang.String value)
                   throws java.sql.SQLClientInfoException
This method is not supported.

Sets the value of the client info property specified by name to the value specified by value.

Applications may use the DatabaseMetaData.getClientInfoProperties method to determine the client info properties supported by the driver and the maximum length that may be specified for each property.

The driver stores the value specified in a suitable location in the database. For example in a special register, session parameter, or system table column. For efficiency the driver may defer setting the value in the database until the next time a statement is executed or prepared. Other than storing the client information in the appropriate place in the database, these methods shall not alter the behavior of the connection in anyway. The values supplied to these methods are used for accounting, diagnostics and debugging purposes only.

The driver shall generate a warning if the client info name specified is not recognized by the driver.

If the value specified to this method is greater than the maximum length for the property the driver may either truncate the value and generate a warning or generate a SQLClientInfoException. If the driver generates a SQLClientInfoException, the value specified was not set on the connection.

The following are standard client info properties. Drivers are not required to support these properties however if the driver supports a client info property that can be described by one of the standard properties, the standard property name should be used.

Specified by:
setClientInfo in interface java.sql.Connection
Parameters:
name - The name of the client info property to set
value - The value to set the client info property to. If the value is null, the current value of the specified property is cleared.

Throws:
java.sql.SQLClientInfoException - if the database server returns an error while setting the client info value on the database server or this method is called on a closed connection

Since:
1.6

setClientInfo

public void setClientInfo(java.util.Properties properties)
                   throws java.sql.SQLClientInfoException
This method is not supported.

Sets the value of the connection's client info properties. The Properties object contains the names and values of the client info properties to be set. The set of client info properties contained in the properties list replaces the current set of client info properties on the connection. If a property that is currently set on the connection is not present in the properties list, that property is cleared. Specifying an empty properties list will clear all of the properties on the connection. See setClientInfo (String, String) for more information.

If an error occurs in setting any of the client info properties, a SQLClientInfoException is thrown. The SQLClientInfoException contains information indicating which client info properties were not set. The state of the client information is unknown because some databases do not allow multiple client info properties to be set atomically. For those databases, one or more properties may have been set before the error occurred.

Specified by:
setClientInfo in interface java.sql.Connection
Parameters:
properties - the list of client info properties to set

Throws:
java.sql.SQLClientInfoException - if the database server returns an error while setting the clientInfo values on the database server or this method is called on a closed connection

Since:
1.6

See Also:
setClientInfo(String, String)

getClientInfo

public java.lang.String getClientInfo(java.lang.String name)
                               throws java.sql.SQLException
This method is not supported.

Returns the value of the client info property specified by name. This method may return null if the specified client info property has not been set and does not have a default value. This method will also return null if the specified client info property name is not supported by the driver.

Applications may use the DatabaseMetaData.getClientInfoProperties method to determine the client info properties supported by the driver.

Specified by:
getClientInfo in interface java.sql.Connection
Parameters:
name - The name of the client info property to retrieve

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

See Also:
DatabaseMetaData.getClientInfoProperties()

getClientInfo

public java.util.Properties getClientInfo()
                                   throws java.sql.SQLException
This method is not supported.

Returns a list containing the name and current value of each client info property supported by the driver. The value of a client info property may be null if the property has not been set and does not have a default value.

Specified by:
getClientInfo in interface java.sql.Connection
Returns:
A Properties object that contains the name and current value of each of the client info properties supported by the driver.

Throws:
java.sql.SQLException - if the database server returns an error when fetching the client info values from the database or this method is called on a closed connection

Since:
1.6

createArrayOf

public java.sql.Array createArrayOf(java.lang.String typeName,
                                    java.lang.Object[] elements)
                             throws java.sql.SQLException
This method is not supported.

Factory method for creating Array objects.

Note: When createArrayOf is used to create an array object that maps to a primitive data type, then it is implementation-defined whether the Array object is an array of that primitive data type or an array of Object.

Note: The JDBC driver is responsible for mapping the elements Object array to the default JDBC SQL type defined in java.sql.Types for the given class of Object. The default mapping is specified in Appendix B of the JDBC specification. If the resulting JDBC type is not the appropriate type for the given typeName then it is implementation defined whether an SQLException is thrown or the driver supports the resulting conversion.

Specified by:
createArrayOf in interface java.sql.Connection
Parameters:
typeName - the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned by Array.getBaseTypeName
elements - the elements that populate the returned object
Returns:
an Array object whose elements map to the specified SQL type

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

createStruct

public java.sql.Struct createStruct(java.lang.String typeName,
                                    java.lang.Object[] attributes)
                             throws java.sql.SQLException
This method is not supported.

Factory method for creating Struct objects.

Specified by:
createStruct in interface java.sql.Connection
Parameters:
typeName - the SQL type name of the SQL structured type that this Struct object maps to. The typeName is the name of a user-defined type that has been defined for this database. It is the value returned by Struct.getSQLTypeName.
attributes - the attributes that populate the returned object

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
This method is not supported.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Specified by:
unwrap in interface java.sql.Wrapper
Parameters:
iface - A Class defining an interface that the result must implement.

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
This method is not supported.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Specified by:
isWrapperFor in interface java.sql.Wrapper
Parameters:
iface - a Class defining an interface.

Throws:
java.sql.SQLException - Always thrown, to indicate that this method is not implemented.

Since:
1.6



Copyright © 2009 SAS Institute Inc. All Rights Reserved.