|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.net.sharenet.ShareNetConnection
public class ShareNetConnection
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. |
|
|
unwrap(java.lang.Class<T> iface)
This method is not supported. |
Field Detail |
---|
public java.sql.SQLWarning warnings
protected com.sas.net.sharenet.Wqecon con
protected com.sas.net.sharenet.Xherscon xher1
protected com.sas.net.sharenet.Defdestroy defdes
protected com.sas.net.sharenet.Tcpmsg msg
protected int sharenetType
protected java.lang.String version_msg
protected int resultSetType
protected int resultSetConcurrency
Constructor Detail |
---|
public ShareNetConnection(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
url
- initial input urlinfo
- java.util.Properties object which contains properties needed to obtain a connection.
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.ShareNetDriver.connect
public ShareNetConnection(java.lang.String host, int port, java.util.Properties info, com.sas.net.sharenet.Wqecon con) throws java.sql.SQLException
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.Method Detail |
---|
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if a ShareNetStatement object cannot be created.public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- An input SQL string.
java.sql.SQLException
- This exception is thrown if a ShareNetPreparedStatement cannot be created.public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- An input SQL string.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
sql
- An input SQL string for optimization.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
autoCommit
- This value must be True. SAS software does not support transactions.
java.sql.SQLException
- This exception is thrown if the value for autoCommit is False.public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if an exception occurred while outstanding
statements were being closed.public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public void close() throws java.sql.SQLException
close
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if a ShareNetDatabaseMetaData object cannot be created.public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
readOnly
- This parameter is ignored.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
catalog
- This parameter is ignored.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public final java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
level
- The transaction level.
java.sql.SQLException
- This exception is thrown if the value of level is not valid.public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
resultSetType
- The result set type TYPE_FORWARD_ONLY.resultSetConcurrency
- The concurrency type CONCUR_READ_ONLY.
java.sql.SQLException
- This exception is thrown if a Statement object cannot be created.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement String.resultSetType
- The result set type TYPE_FORWARD_ONLY.resultSetConcurrency
- The concurrency type CONCUR_READ_ONLY.
java.sql.SQLException
- This exception is thrown if a PreparedStatement object cannot be created.public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- The SQL statement String.resultSetType
- The result set type TYPE_FORWARD_ONLY.resultSetConcurrency
- The concurrency type CONCUR_READ_ONLY.
java.sql.SQLException
- This exception is thrown if a CallableStatement object cannot be created.public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
map
- A type-map object to be associated with this connection.
java.sql.SQLException
- This exception is always thrown.public void setHoldability(int holdability) throws java.sql.SQLException
ResultSet
objects created using this Connection
object to the given holdability.
This method is not implemented.
setHoldability
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public int getHoldability() throws java.sql.SQLException
ResultSet
objects created using this Connection
object.
This method is not implemented.
getHoldability
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
Savepoint
object that represents it.
This method is not implemented.
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
Savepoint
object that represents it.
This method is not implemented.
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
Savepoint
object was set.
This method is not implemented.
rollback
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
Savepoint
object from the current transaction.
This method is not implemented.
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
ResultSet
objects with the given type, concurrency, and holdability.
This method is not implemented.
createStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
PreparedStatement
object that will generate ResultSet
objects with the given type, concurrency, and holdability.
This method is not implemented.
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
CallableStatement
object that will generate ResultSet
objects with the given type, concurrency, and holdability.
This method is not implemented.
prepareCall
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
PreparedStatement
object that has the capability to retrieve auto-generated keys.
This method is not implemented.
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
PreparedStatement
object capable of returning the auto-generated keys designated by the given array.
This method is not implemented.
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
PreparedStatement
object capable of returning the auto-generated keys designated by the given array.
This method is not implemented.
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.protected void deleteStatement(java.lang.Object statement)
statement
- statement object to be removed from the statementListprotected java.lang.String getUser()
protected java.lang.String getUrl()
protected boolean getRemarks()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Exception
- Throwable is required, but it is never thrown.
java.lang.Throwable
protected void connect(java.lang.String myhost, int port) throws ShareNetException
host
- host machine nameport
- TCP/IP port number
ShareNetException
- if an IOException is detectedprotected int execute(java.lang.String command) throws ShareNetException
command
- command
ShareNetException
- if an IOException is detectedprotected boolean isConnected()
protected static java.lang.String formatMsg(int acc, com.sas.net.sharenet.Ans1 ans1, com.sas.net.sharenet.Rcmsg rcmsg) throws ShareNetException
acc
- response code from serverans1
- answer segment one from the serverrcmsg
- response message from the server
ShareNetException
- if an IOException is detectedpublic java.sql.Clob createClob() throws java.sql.SQLException
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
.
createClob
in interface java.sql.Connection
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public java.sql.Blob createBlob() throws java.sql.SQLException
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
.
createBlob
in interface java.sql.Connection
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public java.sql.NClob createNClob() throws java.sql.SQLException
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
.
createNClob
in interface java.sql.Connection
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public java.sql.SQLXML createSQLXML() throws java.sql.SQLException
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.
createSQLXML
in interface java.sql.Connection
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public boolean isValid(int timeout) throws java.sql.SQLException
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.
isValid
in interface java.sql.Connection
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.
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
DatabaseMetaData.getClientInfoProperties()
public void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
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.
setClientInfo
in interface java.sql.Connection
name
- The name of the client info property to setvalue
- The value to set the client info property to. If the
value is null, the current value of the specified
property is cleared.
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
public void setClientInfo(java.util.Properties properties) throws java.sql.SQLClientInfoException
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.
setClientInfo
in interface java.sql.Connection
properties
- the list of client info properties to set
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
setClientInfo(String, String)
public java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
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.
getClientInfo
in interface java.sql.Connection
name
- The name of the client info property to retrieve
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
DatabaseMetaData.getClientInfoProperties()
public java.util.Properties getClientInfo() throws java.sql.SQLException
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.
getClientInfo
in interface java.sql.Connection
Properties
object that contains the name and current value of
each of the client info properties supported by the driver.
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
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
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.
createArrayOf
in interface java.sql.Connection
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
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
Factory method for creating Struct objects.
createStruct
in interface java.sql.Connection
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
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
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.
unwrap
in interface java.sql.Wrapper
iface
- A Class defining an interface that the result must implement.
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
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.
isWrapperFor
in interface java.sql.Wrapper
iface
- a Class defining an interface.
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |