public final class JDCConnection
extends java.lang.Object
implements java.sql.Connection, javax.sql.PooledConnection, com.knowgate.storage.Table
Modifier and Type | Field and Description |
---|---|
static int |
DBMS_ACCESS |
static int |
DBMS_GENERIC |
static int |
DBMS_MSSQL |
static int |
DBMS_MYSQL |
static int |
DBMS_ORACLE |
static int |
DBMS_POSTGRESQL |
static int |
DBMS_SQLITE |
static int |
DBMS_XBASE |
static short |
IdClass |
Constructor and Description |
---|
JDCConnection(java.sql.Connection conn,
JDCConnectionPool pool) |
JDCConnection(java.sql.Connection conn,
JDCConnectionPool pool,
java.lang.String schemaname) |
Modifier and Type | Method and Description |
---|---|
void |
abort(java.util.concurrent.Executor oExec) |
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener) |
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
bindParameter(java.sql.PreparedStatement oStmt,
int iParamIndex,
java.lang.Object oParamValue) |
void |
bindParameter(java.sql.PreparedStatement oStmt,
int iParamIndex,
java.lang.Object oParamValue,
int iSQLType)
Bind parameter into a PreparedStatement
|
void |
clearWarnings() |
void |
close() |
void |
close(java.lang.String sCaller) |
java.util.LinkedList<com.knowgate.storage.Column> |
columns() |
void |
commit() |
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] attributes) |
java.sql.Blob |
createBlob() |
java.sql.Clob |
createClob() |
java.sql.NClob |
createNClob() |
java.sql.SQLXML |
createSQLXML() |
java.sql.Statement |
createStatement() |
java.sql.Statement |
createStatement(int i,
int j) |
java.sql.Statement |
createStatement(int i,
int j,
int k) |
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes) |
void |
delete(com.knowgate.storage.AbstractRecord oRec)
Delete the given register from the underlying table
|
void |
delete(java.lang.String sIndexColumn,
java.lang.String sIndexValue)
Delete registers from the underlying table
|
void |
dispose() |
void |
dispose(java.lang.String sCaller) |
void |
dropIndex(java.lang.String sIndexColumn)
Method dropIndex
|
boolean |
exists(java.lang.String sKey)
Check whether a register with agiven primary key exists at the underlying table
|
boolean |
exists(java.lang.String sObjectName,
java.lang.String sObjectType)
Checks if an object exists at database
Checking is done directly against database catalog tables,
if current user does not have enought priviledges for reading
database catalog tables methos may fail or return a wrong result.
|
com.knowgate.storage.RecordSet |
fetch()
Method fetch
|
com.knowgate.storage.RecordSet |
fetch(int n,
int o)
Method fetch
|
com.knowgate.storage.RecordSet |
fetch(NameValuePair[] aPairs,
int iMaxRows)
Fetch the first n rows matching some indexed values
|
com.knowgate.storage.RecordSet |
fetch(java.lang.String sIndexColumn,
java.util.Date dtIndexValueMin,
java.util.Date dtIndexValueMax)
Fetch all the rows which value for an indexed column is between two dates
|
com.knowgate.storage.RecordSet |
fetch(java.lang.String sIndexColumn,
java.lang.String sIndexValue)
Fetch all the rows matching an indexed value
|
com.knowgate.storage.RecordSet |
fetch(java.lang.String sIndexColumn,
java.lang.String sIndexValue,
int iMaxRows)
Fetch the first n rows matching an indexed value
|
com.knowgate.storage.RecordSet |
fetch(java.lang.String sIndexColumn,
java.lang.String sIndexValueMin,
java.lang.String sIndexValueMax)
Fetch all the rows which value for an indexed column is inside a range
|
boolean |
getAutoCommit() |
java.lang.String |
getCatalog() |
java.util.Properties |
getClientInfo() |
java.lang.String |
getClientInfo(java.lang.String name) |
java.sql.Connection |
getConnection() |
int |
getDataBaseProduct() |
static int |
getDataBaseProduct(java.sql.Connection conn) |
com.knowgate.storage.DataSource |
getDataSource() |
int |
getHoldability() |
long |
getLastUse() |
java.sql.DatabaseMetaData |
getMetaData() |
java.lang.String |
getName() |
int |
getNetworkTimeout() |
JDCConnectionPool |
getPool() |
java.lang.String |
getSchema() |
java.lang.String |
getSchemaName() |
int |
getTransactionIsolation() |
java.util.Map |
getTypeMap() |
java.sql.SQLWarning |
getWarnings() |
boolean |
inUse() |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(java.lang.Class c) |
com.knowgate.storage.RecordSet |
last(java.lang.String sOrderByColumn,
int n,
int o)
Get the last n rows from a table
|
boolean |
lease(java.lang.String sConnectionName) |
com.knowgate.storage.Record |
load(java.lang.String sKey)
Load a register by its primary key
|
java.lang.String |
nativeSQL(java.lang.String sql) |
java.lang.String |
pid()
Get operating system process identifier for this connection
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int i,
int j) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int i,
int j,
int k) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int i) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] params) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int i,
int j) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int i,
int j,
int k) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] params) |
void |
releaseSavepoint(java.sql.Savepoint p) |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener) |
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
void |
rollback() |
void |
rollback(java.sql.Savepoint p) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(java.lang.String catalog) |
void |
setClientInfo(java.util.Properties props) |
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
void |
setHoldability(int h) |
void |
setNetworkTimeout(java.util.concurrent.Executor oExec,
int iTimeout) |
void |
setReadOnly(boolean readOnly) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String s) |
void |
setSchema(java.lang.String sSchema) |
void |
setSchemaName(java.lang.String sname) |
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map typemap) |
void |
store(com.knowgate.storage.AbstractRecord oRec)
Store record at database
|
void |
store(com.knowgate.storage.AbstractRecord oRec,
com.knowgate.storage.Transaction oTrans)
Store record at database
|
void |
truncate()
Truncate table
|
java.lang.Object |
unwrap(java.lang.Class c) |
boolean |
validate() |
public static final short IdClass
public static final int DBMS_GENERIC
public static final int DBMS_MYSQL
public static final int DBMS_POSTGRESQL
public static final int DBMS_MSSQL
public static final int DBMS_ORACLE
public static final int DBMS_XBASE
public static final int DBMS_ACCESS
public static final int DBMS_SQLITE
public JDCConnection(java.sql.Connection conn, JDCConnectionPool pool, java.lang.String schemaname)
public JDCConnection(java.sql.Connection conn, JDCConnectionPool pool)
public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.sql.PooledConnection
public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
public void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener
in interface javax.sql.PooledConnection
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener
in interface javax.sql.PooledConnection
public boolean lease(java.lang.String sConnectionName)
public boolean validate()
public boolean inUse()
public JDCConnectionPool getPool()
public long getLastUse()
public java.lang.String getName()
getName
in interface com.knowgate.storage.Table
public java.util.LinkedList<com.knowgate.storage.Column> columns()
columns
in interface com.knowgate.storage.Table
public static int getDataBaseProduct(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public int getDataBaseProduct() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getSchemaName() throws java.sql.SQLException
java.sql.SQLException
public void setSchemaName(java.lang.String sname)
public void close() throws java.sql.SQLException
close
in interface com.knowgate.storage.Table
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Connection
close
in interface javax.sql.PooledConnection
java.sql.SQLException
public void close(java.lang.String sCaller) throws java.sql.SQLException
java.sql.SQLException
public void dispose()
public void dispose(java.lang.String sCaller)
public java.sql.Connection getConnection()
getConnection
in interface javax.sql.PooledConnection
public boolean isWrapperFor(java.lang.Class c)
isWrapperFor
in interface java.sql.Wrapper
public java.lang.Object unwrap(java.lang.Class c)
unwrap
in interface java.sql.Wrapper
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
createArrayOf
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Blob createBlob() throws java.sql.SQLException
createBlob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Clob createClob() throws java.sql.SQLException
createClob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.NClob createNClob() throws java.sql.SQLException
createNClob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
createStruct
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLXML createSQLXML() throws java.sql.SQLException, java.sql.SQLFeatureNotSupportedException
createSQLXML
in interface java.sql.Connection
java.sql.SQLException
java.sql.SQLFeatureNotSupportedException
public java.sql.Statement createStatement(int i, int j) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int i, int j, int k) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] params) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int i) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int i, int j) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int i, int j, int k) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] params) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int i, int j) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int i, int j, int k) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
public java.util.Properties getClientInfo() throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
java.sql.SQLException
public void setClientInfo(java.util.Properties props) throws java.sql.SQLClientInfoException
setClientInfo
in interface java.sql.Connection
java.sql.SQLClientInfoException
public java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
java.sql.SQLException
public void setClientInfo(java.lang.String name, java.lang.String value)
setClientInfo
in interface java.sql.Connection
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public void setHoldability(int h) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String s) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void rollback(java.sql.Savepoint p) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
public boolean isValid(int timeout) throws java.sql.SQLException
isValid
in interface java.sql.Connection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
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 int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map typemap) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
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 releaseSavepoint(java.sql.Savepoint p) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
public boolean exists(java.lang.String sObjectName, java.lang.String sObjectType) throws java.sql.SQLException, java.lang.UnsupportedOperationException
sObjectName
- Objeto namesObjectType
- Objeto type
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedurejava.sql.SQLException
java.lang.UnsupportedOperationException
- If current database management system is not supported for this methodpublic java.lang.String pid() throws java.sql.SQLException
Get operating system process identifier for this connection
java.sql.SQLException
public void bindParameter(java.sql.PreparedStatement oStmt, int iParamIndex, java.lang.Object oParamValue, int iSQLType) throws java.sql.SQLException
Bind parameter into a PreparedStatement
oStmt
- PreparedStatement where values is to be bindediParamIndex
- int Starting with 1oParamValue
- ObjectiSQLType
- intjava.sql.SQLException
public void bindParameter(java.sql.PreparedStatement oStmt, int iParamIndex, java.lang.Object oParamValue) throws java.sql.SQLException
java.sql.SQLException
public void abort(java.util.concurrent.Executor oExec) throws java.sql.SQLException
abort
in interface java.sql.Connection
java.sql.SQLException
public int getNetworkTimeout() throws java.sql.SQLException
getNetworkTimeout
in interface java.sql.Connection
java.sql.SQLException
public void setNetworkTimeout(java.util.concurrent.Executor oExec, int iTimeout) throws java.sql.SQLException
setNetworkTimeout
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getSchema() throws java.sql.SQLException
getSchema
in interface java.sql.Connection
java.sql.SQLException
public void setSchema(java.lang.String sSchema) throws java.sql.SQLException
setSchema
in interface java.sql.Connection
java.sql.SQLException
public com.knowgate.storage.DataSource getDataSource()
getDataSource
in interface com.knowgate.storage.Table
public boolean exists(java.lang.String sKey) throws com.knowgate.storage.StorageException
Check whether a register with agiven primary key exists at the underlying table
exists
in interface com.knowgate.storage.Table
sKey
- Primary Key Valuecom.knowgate.storage.StorageException
public com.knowgate.storage.Record load(java.lang.String sKey) throws com.knowgate.storage.StorageException
Load a register by its primary key
load
in interface com.knowgate.storage.Table
sKey
- Primary Key Valuecom.knowgate.storage.StorageException
public void store(com.knowgate.storage.AbstractRecord oRec) throws com.knowgate.storage.StorageException
Store record at database
store
in interface com.knowgate.storage.Table
oRec
- Instance of a DBPersist object to be storedcom.knowgate.storage.StorageException
public void store(com.knowgate.storage.AbstractRecord oRec, com.knowgate.storage.Transaction oTrans) throws com.knowgate.storage.StorageException
Store record at database
oRec
- Instance of a DBPersist objectcom.knowgate.storage.StorageException
public void delete(com.knowgate.storage.AbstractRecord oRec) throws com.knowgate.storage.StorageException
Delete the given register from the underlying table
delete
in interface com.knowgate.storage.Table
oRec
- Instance of a DBPersist object to be deletedcom.knowgate.storage.StorageException
public void delete(java.lang.String sIndexColumn, java.lang.String sIndexValue) throws com.knowgate.storage.StorageException
Delete registers from the underlying table
delete
in interface com.knowgate.storage.Table
sIndexColumn
- sIndexValue
- com.knowgate.storage.StorageException
public void dropIndex(java.lang.String sIndexColumn) throws com.knowgate.storage.StorageException
dropIndex
in interface com.knowgate.storage.Table
sIndexColumn
- com.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(int n, int o) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
com.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch() throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
com.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(java.lang.String sIndexColumn, java.lang.String sIndexValue) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
sIndexColumn
- Index column namesIndexValue
- Value for index columncom.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(java.lang.String sIndexColumn, java.lang.String sIndexValueMin, java.lang.String sIndexValueMax) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
sIndexColumn
- Index column namesIndexValueMin
- Range lower boundsIndexValueMin
- Range upper boundcom.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(java.lang.String sIndexColumn, java.util.Date dtIndexValueMin, java.util.Date dtIndexValueMax) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
sIndexColumn
- Index column namesIndexValueMin
- Start DatesIndexValueMin
- End Datecom.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(java.lang.String sIndexColumn, java.lang.String sIndexValue, int iMaxRows) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
sIndexColumn
- Index column namesIndexValue
- Value for index columniMaxRows
- Maximum rows to be readedcom.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet fetch(NameValuePair[] aPairs, int iMaxRows) throws com.knowgate.storage.StorageException
fetch
in interface com.knowgate.storage.Table
aIndexPairs
- Array of NameValuePairsIndexValue
- Value for index columniMaxRows
- Maximum rows to be readedcom.knowgate.storage.StorageException
public com.knowgate.storage.RecordSet last(java.lang.String sOrderByColumn, int n, int o) throws com.knowgate.storage.StorageException
Get the last n rows from a table
last
in interface com.knowgate.storage.Table
sOrderByColumn
- Column used for sorting results in descending ordern
- Maximum number of rows to be retrievedo
- Offsetcom.knowgate.storage.StorageException
public void truncate() throws com.knowgate.storage.StorageException
truncate
in interface com.knowgate.storage.Table
com.knowgate.storage.StorageException