|
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.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. |
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. |
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. |
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 |
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. |
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 detected
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |