public class KKTorque
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
Modifier and Type | Method and Description |
---|---|
static void |
addAdapters()
Add Database Adapters to Torque
|
static java.sql.Connection |
beginTransaction(java.lang.String dbName)
Get a Connection to the database for starting a transaction - defaulting to auto commit being
OFF
|
static java.sql.Connection |
beginTransaction(java.lang.String dbName,
boolean autoCommit)
Get a Connection to the database for starting a transaction
|
static java.lang.String |
fixQueryString(java.lang.String queryString)
Some post processing of the query string to fix the query so that it will run.
|
static org.apache.torque.adapter.Adapter |
getAdapter(java.lang.String name)
Returns the database adapter for a specific database name.
|
static org.apache.torque.map.DatabaseMap |
getDatabaseMap(java.lang.String name)
Returns the database map information for a given database.
|
static org.apache.torque.adapter.Adapter |
getDB(java.lang.String name)
Deprecated.
use getAdapter(String) instead. This method will be removed in a future version
of Torque.
|
static java.lang.String |
getDbOwner() |
static KKDbMapMgr |
getKkDbMapMgr() |
static char |
getStringDelimiter()
Returns the character used to indicate the beginning and end of a piece of text used in a SQL
statement (generally a single quote).
|
static java.lang.String |
getTableDotColumn(org.apache.torque.map.ColumnMap colMap)
Get tableName + "." + columnName from the ColumnMap
|
static void |
init()
Initialise/Amend the KonaKart Torque data structures for "problem" databases (like Oracle)
|
static boolean |
isColumnAnOracleCLOB(java.lang.String table,
java.lang.String column,
java.lang.String key)
Is the custom_attrs column is an Oracle CLOB? Return true if it is otherwise false.
|
static void |
setDbOwner(java.lang.String dbOwner) |
public static void init() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic static java.lang.String fixQueryString(java.lang.String queryString)
queryString
- the queryStringpublic static KKDbMapMgr getKkDbMapMgr()
public static java.lang.String getDbOwner()
public static void setDbOwner(java.lang.String dbOwner)
dbOwner
- The dbOwner to set.public static org.apache.torque.map.DatabaseMap getDatabaseMap(java.lang.String name) throws org.apache.torque.TorqueException
name
- The name of the database corresponding to the DatabaseMap
to
retrieve, or null for the default database.DatabaseMap
, not null.org.apache.torque.TorqueException
- if Torque is not initialized and name is null.public static char getStringDelimiter()
public static java.sql.Connection beginTransaction(java.lang.String dbName) throws org.apache.torque.TorqueException, java.sql.SQLException
dbName
- database nameorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionjava.sql.SQLException
- an unexpected SQLException exceptionpublic static java.sql.Connection beginTransaction(java.lang.String dbName, boolean autoCommit) throws org.apache.torque.TorqueException, java.sql.SQLException
dbName
- database nameautoCommit
- true for auto commitorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionjava.sql.SQLException
- an unexpected SQLException exceptionpublic static void addAdapters()
@Deprecated public static org.apache.torque.adapter.Adapter getDB(java.lang.String name) throws org.apache.torque.TorqueException
name
- the database name, or null for the default db.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static org.apache.torque.adapter.Adapter getAdapter(java.lang.String name) throws org.apache.torque.TorqueException
name
- the database name, or null for the default db.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static java.lang.String getTableDotColumn(org.apache.torque.map.ColumnMap colMap)
colMap
- the ColumnMappublic static boolean isColumnAnOracleCLOB(java.lang.String table, java.lang.String column, java.lang.String key)
table
- the database table to checkcolumn
- the column in the table to checkkey
- key of the tableCopyright © 2018 DS Data Systems UK Ltd.