public class DatabaseConnection
extends java.lang.Object
implements java.sql.Connection
DatabaseConnection
the class provides the functions for database connection controlling.Constructor and Description |
---|
DatabaseConnection(java.sql.Connection pconn)
The constructor
DatabaseConnection creates a new instance(object) of the class. |
Modifier and Type | Method and Description |
---|---|
void |
abort(java.util.concurrent.Executor arg0) |
void |
clearWarnings()
calls the
clearWarnings -method of the connection. |
void |
close()
The method
close closes a connection. |
void |
commit()
The method
commit sends a commit to the database system. |
void |
connectionlog(java.lang.String topic,
java.lang.String message1,
java.lang.String message2)
The method
connectionlog writes a message concerning the connection into the database logfile. |
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements) |
java.sql.Blob |
createBlob() |
java.sql.Clob |
createClob() |
java.sql.NClob |
createNClob() |
java.sql.SQLXML |
createSQLXML() |
java.sql.Statement |
createStatement()
The method
createStatement calls the concerning method of the connection. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
The method
createStatement calls the concerning method of the connection. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
The method
createStatement calls the concerning method of the connection. |
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes) |
boolean |
getAutoCommit()
calls the
getAutoCommit -method of the connection. |
java.lang.String |
getCatalog()
calls the
getCatalog -method of the connection. |
java.util.Properties |
getClientInfo() |
java.lang.String |
getClientInfo(java.lang.String name) |
java.lang.String |
getDatabase()
get field: the own database system object of the class.
|
DatabaseSystem |
getDatabaseSystem()
get field: the own database system object of the class.
|
boolean |
getEnableLogging()
get field: logging on/off !!!
|
int |
getHoldability()
calls the
getHoldability -method of the connection. |
java.sql.DatabaseMetaData |
getMetaData()
calls the
getMetaData -method of the connection. |
int |
getNetworkTimeout() |
java.lang.String |
getSchema() |
int |
getTransactionIsolation()
calls the
getTransactionIsolation -method of the connection. |
java.util.Map |
getTypeMap()
calls the
getTypeMap -method of the connection. |
java.lang.String |
getUsername()
get field: user using the connection.
|
java.sql.SQLWarning |
getWarnings()
calls the
getWarnings -method of the connection. |
boolean |
isClosed()
calls the
isClosed -method of the connection. |
boolean |
isReadOnly()
calls the
isReadOnly -method of the connection. |
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(java.lang.Class iface) |
java.lang.String |
nativeSQL(java.lang.String sql_statement)
The method
nativeSQL calls the concerning method of the connection. |
java.sql.CallableStatement |
prepareCall(java.lang.String pst)
The method
prepareCall calls the prepareCall method of the connection. |
java.sql.CallableStatement |
prepareCall(java.lang.String statement,
int resultSetType,
int resultSetConcurrency)
The method
prepareCall calls the prepareCall method of the connection. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
The method
prepareCall calls the prepareCall method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
The method
prepareStatement calls the concerning method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
The method
prepareStatement calls the concerning method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
The method
prepareStatement calls the concerning method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
The method
prepareStatement calls the concerning method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
The method
prepareStatement calls the concerning method of the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
The method
prepareStatement calls the concerning method of the connection. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
The method
releaseSavepoint releases the save point of the connection. |
void |
rollback()
The method
rollback sends a roll back to the database system. |
void |
rollback(java.sql.Savepoint savepoint)
The method
rollback sends a roll back to the database system. |
void |
setAutoCommit(boolean onoff)
calls the
setAutoCommit -method of the connection. |
void |
setCatalog(java.lang.String input)
calls the
setCatalog -method of the connection. |
void |
setClientInfo(java.util.Properties properties) |
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
void |
setDatabase(java.lang.String input)
set field: the own database system object of the class.
|
void |
setDatabaseSystem(DatabaseSystem input)
set field: the own database system object of the class.
|
void |
setEnableLogging(boolean input)
set field: logging on/off !!!
|
void |
setHoldability(int input)
calls the
setHoldability -method of the connection. |
void |
setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds) |
void |
setReadOnly(boolean input)
calls the
setReadOnly -method of the connection. |
java.sql.Savepoint |
setSavepoint()
calls the
setSavepoint -method of the connection. |
java.sql.Savepoint |
setSavepoint(java.lang.String input)
calls the
setSavepoint -method of the connection. |
void |
setSchema(java.lang.String schema) |
void |
setTransactionIsolation(int input)
calls the
setTransactionIsolation -method of the connection. |
void |
setTypeMap(java.util.Map input)
calls the
setTypeMap -method of the connection. |
void |
setUserName(java.lang.String input)
set field: user using the connection.
|
java.lang.Object |
unwrap(java.lang.Class iface) |
public DatabaseConnection(java.sql.Connection pconn)
DatabaseConnection
creates a new instance(object) of the class.pconn
- the current connection.public void setDatabaseSystem(DatabaseSystem input)
input
- the database systempublic DatabaseSystem getDatabaseSystem()
public void setUserName(java.lang.String input)
input
- user namepublic java.lang.String getUsername()
public void setDatabase(java.lang.String input)
input
- databasepublic java.lang.String getDatabase()
public void setEnableLogging(boolean input)
input
- set logging on / offpublic boolean getEnableLogging()
public void setAutoCommit(boolean onoff) throws java.sql.SQLException
setAutoCommit
-method of the connection.setAutoCommit
in interface java.sql.Connection
onoff
- set auto commitjava.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
-method of the connection.getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
-method of the connection.isClosed
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
-method of the connection.isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
-method of the connection.getMetaData
in interface java.sql.Connection
java.sql.SQLException
public void setReadOnly(boolean input) throws java.sql.SQLException
setReadOnly
-method of the connection.setReadOnly
in interface java.sql.Connection
input
- read onlyjava.sql.SQLException
public void setCatalog(java.lang.String input) throws java.sql.SQLException
setCatalog
-method of the connection.setCatalog
in interface java.sql.Connection
input
- catalogjava.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
-method of the connection.getCatalog
in interface java.sql.Connection
java.sql.SQLException
public void setTransactionIsolation(int input) throws java.sql.SQLException
setTransactionIsolation
-method of the connection.setTransactionIsolation
in interface java.sql.Connection
input
- Transaction Isolationjava.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
-method of the connection.getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
-method of the connection.getWarnings
in interface java.sql.Connection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
-method of the connection.clearWarnings
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map input) throws java.sql.SQLException
setTypeMap
-method of the connection.setTypeMap
in interface java.sql.Connection
input
- mapjava.sql.SQLException
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
-method of the connection.getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String input) throws java.sql.SQLException
setSavepoint
-method of the connection.setSavepoint
in interface java.sql.Connection
input
- save pointjava.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
-method of the connection.setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void setHoldability(int input) throws java.sql.SQLException
setHoldability
-method of the connection.setHoldability
in interface java.sql.Connection
input
- Holdabilityjava.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
-method of the connection.getHoldability
in interface java.sql.Connection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
releases the save point of the connection.releaseSavepoint
in interface java.sql.Connection
savepoint
- the save point.java.sql.SQLException
- if error.public void connectionlog(java.lang.String topic, java.lang.String message1, java.lang.String message2) throws java.sql.SQLException
connectionlog
writes a message concerning the connection into the database logfile.topic
- the message topic.message1
- the first message.message2
- the second message.java.sql.SQLException
- if error.public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
calls the prepareCall method of the connection.prepareCall
in interface java.sql.Connection
sql
- (see java documentation).resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).resultSetHoldability
- (see java documentation).java.sql.SQLException
- if error.public java.sql.CallableStatement prepareCall(java.lang.String pst) throws java.sql.SQLException
prepareCall
calls the prepareCall method of the connection.prepareCall
in interface java.sql.Connection
pst
- sql (see java documentation).java.sql.SQLException
- if error.public java.sql.CallableStatement prepareCall(java.lang.String statement, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
calls the prepareCall method of the connection.prepareCall
in interface java.sql.Connection
statement
- sql (see java documentation).resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).java.sql.SQLException
- if error.public void commit() throws java.sql.SQLException
commit
sends a commit to the database system.commit
in interface java.sql.Connection
java.sql.SQLException
- if error.public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
sends a roll back to the database system.rollback
in interface java.sql.Connection
savepoint
- the save point.java.sql.SQLException
- if error.public void rollback() throws java.sql.SQLException
rollback
sends a roll back to the database system.rollback
in interface java.sql.Connection
java.sql.SQLException
- if error.public void close() throws java.sql.SQLException
close
closes a connection.close
in interface java.lang.AutoCloseable
close
in interface java.sql.Connection
java.sql.SQLException
- if error.public java.lang.String nativeSQL(java.lang.String sql_statement) throws java.sql.SQLException
nativeSQL
calls the concerning method of the connection.nativeSQL
in interface java.sql.Connection
sql_statement
- the sql statement.java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).columnNames
- (see java documentation).java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).columnIndexes
- (see java documentation).java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).autoGeneratedKeys
- (see java documentation).java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).java.sql.SQLException
- if error.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
calls the concerning method of the connection.prepareStatement
in interface java.sql.Connection
sql
- (see java documentation).resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).resultSetHoldability
- (see java documentation).java.sql.SQLException
- if error.public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
calls the concerning method of the connection.createStatement
in interface java.sql.Connection
java.sql.SQLException
- if error.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
calls the concerning method of the connection.createStatement
in interface java.sql.Connection
resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).java.sql.SQLException
- if error.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
calls the concerning method of the connection.createStatement
in interface java.sql.Connection
resultSetType
- (see java documentation).resultSetConcurrency
- (see java documentation).resultSetHoldability
- (see java documentation).java.sql.SQLException
- if error.public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes)
createStruct
in interface java.sql.Connection
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements)
createArrayOf
in interface java.sql.Connection
public java.util.Properties getClientInfo()
getClientInfo
in interface java.sql.Connection
public java.lang.String getClientInfo(java.lang.String name)
getClientInfo
in interface java.sql.Connection
public void setClientInfo(java.util.Properties properties)
setClientInfo
in interface java.sql.Connection
public void setClientInfo(java.lang.String name, java.lang.String value)
setClientInfo
in interface java.sql.Connection
public boolean isValid(int timeout)
isValid
in interface java.sql.Connection
public java.sql.SQLXML createSQLXML()
createSQLXML
in interface java.sql.Connection
public java.sql.NClob createNClob()
createNClob
in interface java.sql.Connection
public java.sql.Blob createBlob()
createBlob
in interface java.sql.Connection
public java.sql.Clob createClob()
createClob
in interface java.sql.Connection
public boolean isWrapperFor(java.lang.Class iface)
isWrapperFor
in interface java.sql.Wrapper
public java.lang.Object unwrap(java.lang.Class iface)
unwrap
in interface java.sql.Wrapper
public void abort(java.util.concurrent.Executor arg0) 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 java.lang.String getSchema() throws java.sql.SQLException
getSchema
in interface java.sql.Connection
java.sql.SQLException
public void setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds) throws java.sql.SQLException
setNetworkTimeout
in interface java.sql.Connection
java.sql.SQLException
public void setSchema(java.lang.String schema) throws java.sql.SQLException
setSchema
in interface java.sql.Connection
java.sql.SQLException