|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceAccessor
Interface for access to physical resources. Each Database
object has one resource accessor associated which is passed at
construction time.
Nested Class Summary | |
---|---|
static interface |
ResourceAccessor.AutoKeyMode
|
static interface |
ResourceAccessor.Config
|
static interface |
ResourceAccessor.DBType
|
Field Summary | |
---|---|
static java.lang.String |
REVISION_ID
|
static java.util.Date |
SYSTIME_DEFAULT
Default value for the database system time identifier, if the database specific CURRENT_TIMESTAMP has to be used Default: Thu Jan 01 00:00:01 CET 0001 |
Method Summary | |
---|---|
java.lang.String |
formatOperator(java.lang.String operator,
java.lang.Object rawValue)
Performs an SQL formating of the passed operator. |
java.lang.Object |
formatPreparedValue(java.lang.Object value)
Performs a type conversion of a passed value for usage in a prepared statement write access function. |
java.lang.String |
formatValue(java.lang.Object value)
Performs an SQL formating of the passed value |
java.lang.String[] |
getAutoFields(java.sql.Statement stmt,
java.lang.String[] rawAutoFields)
Return an array of auto fields to be used as parameter for an SQL insertion operation. |
java.sql.ResultSet |
getAutoFieldVals(java.sql.Statement stmt,
java.lang.String[] rawAutoFields)
Fetch the values for auto-generated fields from the last insertion execution performed on the passed statement. |
java.sql.Connection |
getConnection(java.lang.String db)
Returns a connection to the database represented by the ResourceAccessor. |
java.lang.String |
getDBType()
Returns the type of DB being represented by this resource accessor. |
java.util.Date |
getSystime()
Returns the timestamp, that is currently used to identify, that a date has to be replaced by the database server's system time. |
java.lang.String |
getTableName(java.lang.String logicalTableName)
Returns the physical table name for the logical table name refered to by parameter logicalTableName |
java.lang.String |
getURL(java.lang.String db)
Retrieves the URL for this DBMS represented by the ResourceAccessor. |
java.lang.String |
getUserName(java.lang.String db)
Retrieves the user name as known to this database represented by the ResourceAccessor. |
boolean |
isLogging()
Returns the current SQL logging state |
void |
releaseConnection()
Release any connections being allocated by calls of getConnection(java.lang.String) . |
void |
releaseConnection(java.sql.Connection con)
Release a particular connection being allocated by a call of getConnection(java.lang.String) . |
boolean |
setLogging(Database db,
boolean state)
Switch SQL logging on and off, according to the the value of parameter state . |
void |
sqlLog(Database db,
java.lang.String operation)
Writes the passed operation to the SQL log, if logging is enabled |
void |
sqlLogError(Database db,
java.sql.SQLException sqlx)
Writes the passed SQL exception to the log, if logging is enabled |
Field Detail |
---|
static final java.util.Date SYSTIME_DEFAULT
static final java.lang.String REVISION_ID
Method Detail |
---|
java.util.Date getSystime()
boolean setLogging(Database db, boolean state)
state
.
state
if the ResourceAccessor denies toggling.boolean isLogging()
void sqlLog(Database db, java.lang.String operation)
void sqlLogError(Database db, java.sql.SQLException sqlx)
java.sql.Connection getConnection(java.lang.String db) throws java.lang.Exception
java.lang.Exception
void releaseConnection() throws java.sql.SQLException
getConnection(java.lang.String)
. This function may
be called, before a worker thread is about to close down
or fall asleep.
java.sql.SQLException
void releaseConnection(java.sql.Connection con) throws java.sql.SQLException
getConnection(java.lang.String)
. This function is
called after every every single database operation
java.sql.SQLException
java.lang.String[] getAutoFields(java.sql.Statement stmt, java.lang.String[] rawAutoFields) throws java.lang.Exception
stmt
- The statement which is about to be executedrawAutoFields
- The auto fields to consider as declared in a descriptor
java.lang.Exception
java.sql.ResultSet getAutoFieldVals(java.sql.Statement stmt, java.lang.String[] rawAutoFields) throws java.sql.SQLException
stmt
- SQL statement object which was last be used to execute an insertion.rawAutoFields
- The auto fields to consider as declared in a descriptor
java.sql.SQLException
java.lang.String getTableName(java.lang.String logicalTableName) throws java.lang.Exception
logicalTableName
java.lang.Exception
java.lang.String formatValue(java.lang.Object value)
formatValue
in interface SQLFormatter
java.lang.String formatOperator(java.lang.String operator, java.lang.Object rawValue)
formatOperator
in interface SQLFormatter
operator
- Any of the operators defined in SQLExpression.Operator
rawValue
- The raw value the operator is applied to before it
is formated by formatValue(java.lang.Object)
. May be null.java.lang.Object formatPreparedValue(java.lang.Object value)
formatPreparedValue
in interface SQLFormatter
java.lang.String getURL(java.lang.String db) throws java.lang.Exception
db
-
java.lang.Exception
java.lang.String getUserName(java.lang.String db) throws java.lang.Exception
db
-
java.lang.Exception
java.lang.String getDBType()
#DBType
for the
type keys which are supported by default.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |