public class JBaseJDBCSocketConnection extends JBaseJDBCConnection implements JBaseJDBCGlobals
JBaseJDBCGlobals.TYPES
CHAR_AM, CHAR_SM, CHAR_VM, SHORT_AM, SHORT_CHAR_AM, SHORT_CHAR_SM, SHORT_CHAR_VM, SHORT_SM, SHORT_VM
Constructor and Description |
---|
JBaseJDBCSocketConnection(java.lang.String url,
java.util.Properties info) |
Modifier and Type | Method and Description |
---|---|
protected void |
authenticate() |
protected void |
authenticate(java.lang.String account) |
void |
clearWarnings() |
void |
close() |
void |
commit()
Makes all changes made since the previous commit/rollback permanent
and releases any database locks currently held by this Connection object.
|
protected int |
compressionThreshold() |
protected void |
connect(java.lang.String host,
int port) |
java.sql.Statement |
createStatement()
Creates a Statement object for sending SQL statements to the database.
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
TODO: Creates a Statement object that will generate ResultSet objects with the given type and concurrency.
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
TODO: Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
|
void |
doConnection() |
boolean |
getAutoCommit()
Retrieves the current auto-commit mode for this Connection object.
|
java.lang.String |
getCatalog()
Retrieves this Connection object's current catalog name.
|
protected java.lang.String |
getConnectionInfo()
Debugging tool.
|
int |
getHoldability() |
protected java.util.Properties |
getInfo() |
protected int |
getIsolationLevel() |
java.sql.DatabaseMetaData |
getMetaData()
Retrieves a DatabaseMetaData object that contains metadata about the database
to which this Connection object represents a connection.
|
protected Response |
getResponse()
Reads response from the server.
|
int |
getTransactionIsolation() |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap()
TODO: Retrieves the Map object associated with this Connection object.
|
java.sql.SQLWarning |
getWarnings()
Retrieves the first warning reported by calls on this Connection object.
|
boolean |
isClosed() |
protected boolean |
isCompressionRequired() |
boolean |
isEnabledNaiveTrustManager() |
boolean |
isReadOnly()
Retrieves whether this Connection object is in read-only mode.
|
protected boolean |
isSSLRequired() |
java.lang.String |
nativeSQL(java.lang.String sql)
Converts the given SQL statement into the system's native SQL grammar.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
TODO: Creates a CallableStatement object for calling database stored procedures.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
TODO: Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
TODO: Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a PreparedStatement object for sending parameterized SQL statements to the database.
|
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) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
jBASE NOTE: Currently jSQL does no support savepoints.
|
void |
rollback()
Undoes all changes made in the current transaction and releases any database locks
currently held by this Connection object.
|
void |
rollback(java.sql.Savepoint savepoint)
Undoes all changes made after the given Savepoint object was set.
|
protected void |
sendProperties() |
void |
setAutoCommit(boolean autoCommit)
Sets this connection's auto-commit mode to the given state.
|
void |
setCatalog(java.lang.String catalog)
Sets the given catalog name in order to select a subspace of this Connection object's database
in which to work.
|
void |
setHoldability(int holdability) |
void |
setReadOnly(boolean readOnly)
Puts this connection in read-only mode as a hint to the driver to enable database optimizations.
|
java.sql.Savepoint |
setSavepoint()
jBASE NOTE: Currently jSQL does no support savepoints.
|
java.sql.Savepoint |
setSavepoint(java.lang.String name)
jBASE NOTE: Currently jSQL does no support savepoints.
|
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map map)
TODO: Installs the given TypeMap object as the type map for this Connection object.
|
createBlob
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public JBaseJDBCSocketConnection(java.lang.String url, java.util.Properties info)
public void doConnection() throws java.sql.SQLException
doConnection
in class JBaseJDBCConnection
java.sql.SQLException
protected void authenticate() throws java.sql.SQLException
java.sql.SQLException
protected void authenticate(java.lang.String account) throws java.sql.SQLException
java.sql.SQLException
protected void sendProperties() throws java.sql.SQLException
java.sql.SQLException
protected boolean isSSLRequired()
protected boolean isCompressionRequired()
protected int compressionThreshold()
protected java.util.Properties getInfo()
protected int getIsolationLevel()
protected java.lang.String getConnectionInfo()
protected void connect(java.lang.String host, int port) throws java.security.NoSuchAlgorithmException, java.net.UnknownHostException, java.io.IOException
java.security.NoSuchAlgorithmException
java.net.UnknownHostException
java.io.IOException
public boolean isEnabledNaiveTrustManager()
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurs or this Connection object is in auto-commit modepublic void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurs or this Connection object is in auto-commit modepublic boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occursConnection.getAutoCommit()
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurspublic void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
autoCommit
- true to enable auto-commit mode; false to disable itjava.sql.SQLException
- - if a database access error occursConnection.setAutoCommit(boolean)
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
readOnly
- true enables read-only mode; false disables itjava.sql.SQLException
- if a database access error occurs or this method is called during a transactionpublic java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occursConnection.getCatalog()
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
catalog
- the name of a catalog (subspace in this Connection object's database) in which to workjava.sql.SQLException
- if a database access error occurspublic java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurspublic java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurs or this method is called on a closed connectionSQLWarning
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurs or this Connection object is currently in auto-commit modeSavepoint
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
savepoint
- the Savepoint object to be removedjava.sql.SQLException
- if a database access error occurs or the given Savepoint object is not a valid savepoint in the current transactionpublic void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
savepoint
- the Savepoint object to roll back tojava.sql.SQLException
- if a database access error occurs, the Savepoint object is no longer valid, or this Connection object is currently in auto-commit moderollback
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurspublic java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
resultSetType
- a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency
- a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEjava.sql.SQLException
- if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrencypublic java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
resultSetType
- one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency
- one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability
- one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMITjava.sql.SQLException
- if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdabilityResultSet
public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurspublic void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
map
- the java.util.Map object to install as the replacement for this Connection object's default type mapjava.sql.SQLException
- if a database access error occurs or the given parameter is not a java.util.Map objectConnection.getTypeMap()
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
sql
- an SQL statement that may contain one or more '?' parameter placeholdersjava.sql.SQLException
- if a database access error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string.java.sql.SQLException
- if a database access error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- a String object that is the SQL statement to be sent to the database; may contain on or more ? parametersresultSetType
- a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency
- a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEjava.sql.SQLException
- if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrencypublic java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- a String object that is the SQL statement to be sent to the database; may contain on or more ? parametersresultSetType
- one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency
- one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability
- one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMITjava.sql.SQLException
- if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdabilitypublic java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- an SQL statement that may contain one or more '?' IN parameter placeholdersjava.sql.SQLException
- if a database access error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- - an SQL statement that may contain one or more '?' IN parameter placeholdersautoGeneratedKeys
- - a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYSjava.sql.SQLException
- - if a database access error occurs or the given parameter is not a Statement constant indicating whether auto-generated keys should be returnedpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
name
- a String containing the name of the savepointjava.sql.SQLException
- if a database access error occurs or this Connection object is currently in auto-commit modeSavepoint
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
protected Response getResponse() throws java.sql.SQLException
java.sql.SQLException