|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.db.E4DBConnectionDefault
public class E4DBConnectionDefault
This is the main class that connects the application with the database, each statement
will be executed in single statement transaction (SST) mode and commit/rollback is not
possible. You can use the #E4DBConnectionDefault() function to create a new connection,
using the default JDBC connection string and database (which is defined in the E4DBSettings)
but if a connection was already created for this database, then this connection will be used. This
is the reason, why commit/rollback won't work as they would influence all connections used. Never
close this connection until your application will be terminated.
E4DBSettings,
E4DBConnectionTransactional| Field Summary | |
|---|---|
static int |
_DB_TYPE_DB2
Value for getDatabaseType() when running DB2 on AS/400. |
static int |
_DB_TYPE_MS_ACCESS
Value for getDatabaseType() when running MS-ACCESS. |
static int |
_DB_TYPE_MY_SQL
Value for getDatabaseType() when running My-SQL. |
static int |
_DB_TYPE_OTHER
Value for getDatabaseType() when database is different than the known databases here. |
static int |
_DB_TYPE_SQL_SERVER
Value for getDatabaseType() when running SQL-Server. |
static java.lang.String |
JDBCDRIVER_MS
Common used JDBC driver for Microsoft, used for e.g. |
static java.lang.String |
JDBCDRIVER_OPTA
Well established JDBC driver (often used in E4S projects) for MS-SQL and other databases. |
static java.lang.String |
JDBCDRIVER_SUN
Common used JDBC driver for Sun Microsystems, used for e.g. |
protected java.sql.Connection |
m_Connection
|
protected boolean |
m_Connection_pooled
|
protected static boolean |
m_logging_checked
|
protected static AEP_JDBC_Connection_Intf |
ms_aep_connection
|
protected static java.util.Hashtable |
ms_cached_connections
This is a list of connections, each identified by driver, connection, user and password |
protected static int |
ms_connection_counter
|
protected static int |
ms_connection_counter_max
|
protected static java.lang.String |
ms_JDBC_CONNECTION
|
protected static int |
ms_JDBC_DATABASE_TYPE
|
protected static java.lang.String |
ms_JDBC_DRIVER
|
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
|
E4DBConnectionDefault(java.sql.Connection con,
int dbtype)
|
protected |
E4DBConnectionDefault(java.sql.Connection con,
java.lang.String monitorstring,
int dbtype)
|
|
E4DBConnectionDefault(E4DBConnectionDefault con)
|
protected |
E4DBConnectionDefault(int dbtype)
|
|
E4DBConnectionDefault(java.lang.String driver_name,
java.lang.String connection_name,
int dbtype)
|
|
E4DBConnectionDefault(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
int dbtype)
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
Get version info string from subversion. |
void |
close()
|
boolean |
connectionIsPooled()
Get the pooling mode for the JDBC driver. |
void |
finalize()
|
java.lang.String |
getCatalog()
Get the catalog. |
java.sql.Connection |
getConnection()
Get the underlaying JDBC database connection. |
static java.sql.Connection[] |
getConnectionCache()
Get an array of connections cached. |
static int |
getConnectionCounter()
|
java.util.Date |
getCreated()
|
java.sql.DatabaseMetaData |
getDatabaseMetaData()
Get the database meta data. |
int |
getDatabaseType()
Hold information about the database type. |
static E4DBConnectionDefault |
getDefaultConnection()
|
java.lang.String |
getID()
|
java.util.Vector |
getIndexes(E4DBTableName tablename)
Retrieve all index names out of the current database connection for the specified table. |
static E4DBConnection_Intf |
getInstance()
|
static java.lang.String |
getJdbcConnection()
Get the name of the JDBC connection. |
static java.lang.String |
getJdbcDriver()
|
E4DBStatement |
getStatement()
Create a new JDBC/SQL Statement. |
java.util.Vector |
getTables()
Retrieve all tables out of the current database connection. |
java.util.Vector |
getViews()
Retrieve all tables out of the current database connection. |
protected void |
init(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
|
protected void |
initLogging()
|
protected void |
initMONITOR(java.lang.String flag)
|
protected void |
initPool(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
|
protected void |
initShared(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
|
boolean |
istabledefined(E4DBTableName check_tablename)
Check for existance of a table |
static void |
resetConnectionCache()
|
static void |
setAEP(AEP_JDBC_Connection_Intf aep_connection)
Set the object to trigger the connection. |
void |
setConnection(java.sql.Connection con)
Set the underlaying JDBC database connection, not recommended. |
void |
setConnection(E4DBConnectionDefault con)
Set the underlaying JDBC database connection, not recommended. |
void |
setDatabaseType(int dbtype)
Defines information about the database type. |
static void |
setJdbcConnection(java.lang.String connection)
Set the name of the JDBC connection. |
static void |
setJdbcDatabaseType(int dbtype)
|
static void |
setJdbcDriver(java.lang.String driver)
|
java.lang.String |
toString()
|
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected volatile java.sql.Connection m_Connection
protected boolean m_Connection_pooled
protected static int ms_connection_counter
protected static int ms_connection_counter_max
protected static AEP_JDBC_Connection_Intf ms_aep_connection
protected static java.util.Hashtable ms_cached_connections
protected static boolean m_logging_checked
public static int _DB_TYPE_SQL_SERVER
getDatabaseType() when running SQL-Server.
getDatabaseType(),
setDatabaseType(int)public static int _DB_TYPE_MY_SQL
getDatabaseType() when running My-SQL.
getDatabaseType(),
setDatabaseType(int)public static int _DB_TYPE_MS_ACCESS
getDatabaseType() when running MS-ACCESS.
getDatabaseType(),
setDatabaseType(int)public static int _DB_TYPE_DB2
getDatabaseType() when running DB2 on AS/400.
getDatabaseType(),
setDatabaseType(int)public static int _DB_TYPE_OTHER
getDatabaseType() when database is different than the known databases here.
getDatabaseType(),
setDatabaseType(int)public static final java.lang.String JDBCDRIVER_MS
public static final java.lang.String JDBCDRIVER_SUN
public static final java.lang.String JDBCDRIVER_OPTA
protected static java.lang.String ms_JDBC_DRIVER
protected static java.lang.String ms_JDBC_CONNECTION
protected static int ms_JDBC_DATABASE_TYPE
| Constructor Detail |
|---|
protected E4DBConnectionDefault(int dbtype)
public E4DBConnectionDefault(java.sql.Connection con,
int dbtype)
protected E4DBConnectionDefault(java.sql.Connection con,
java.lang.String monitorstring,
int dbtype)
public E4DBConnectionDefault(E4DBConnectionDefault con)
public E4DBConnectionDefault(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
int dbtype)
throws E4DBException
E4DBException
public E4DBConnectionDefault(java.lang.String driver_name,
java.lang.String connection_name,
int dbtype)
throws E4DBException
E4DBException| Method Detail |
|---|
protected void initMONITOR(java.lang.String flag)
public static E4DBConnection_Intf getInstance()
throws E4DBException
E4DBException
public static E4DBConnectionDefault getDefaultConnection()
throws E4DBException
E4DBException
protected void init(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
throws E4DBException
E4DBException
protected void initShared(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
throws E4DBException
E4DBException
protected void initPool(java.lang.String driver_name,
java.lang.String connection_name,
java.lang.String userid,
java.lang.String password,
boolean transaction)
throws E4DBException
E4DBExceptionprotected void initLogging()
public E4DBStatement getStatement()
throws E4DBException
getStatement in interface E4DBConnection_IntfE4DBException
public java.sql.DatabaseMetaData getDatabaseMetaData()
throws E4DBException
getDatabaseMetaData in interface E4DBConnection_IntfE4DBException
public java.util.Vector getIndexes(E4DBTableName tablename)
throws E4DBException
getIndexes in interface E4DBConnection_Intftablename - the table to lookup
E4DBException
public java.util.Vector getTables()
throws E4DBException
getTables in interface E4DBConnection_Intfe4s.db.dict
E4DBExceptionE4DBTableName,
istabledefined(e4s.db.E4DBTableName)
public java.util.Vector getViews()
throws E4DBException
e4s.db.dict
E4DBExceptionE4DBTableName,
istabledefined(e4s.db.E4DBTableName)
public boolean istabledefined(E4DBTableName check_tablename)
throws E4DBException
istabledefined in interface E4DBConnection_Intfcheck_tablename - the table who's existance to be prooven
E4DBExceptionE4DBTableName,
getTables()public static java.lang.String getJdbcDriver()
public static void setJdbcDriver(java.lang.String driver)
throws java.lang.Exception
java.lang.Exception
public static void setJdbcDatabaseType(int dbtype)
throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String getJdbcConnection()
setJdbcConnection(java.lang.String),
getJdbcDriver(),
E4DBSettings.getJdbcConnection(boolean)public static void setJdbcConnection(java.lang.String connection)
E4DBSettings.
getJdbcConnection(),
setJdbcDriver(java.lang.String)public int getDatabaseType()
getDatabaseType in interface E4DBConnection_Intf_DB_TYPE_SQL_SERVER,
_DB_TYPE_MY_SQL,
_DB_TYPE_MS_ACCESS,
setDatabaseType(int)public void setDatabaseType(int dbtype)
dbtype - one of _DB_TYPE_SQL_SERVER, _DB_TYPE_MY_SQL, _DB_TYPE_MS_ACCESS_DB_TYPE_SQL_SERVER,
_DB_TYPE_MY_SQL,
_DB_TYPE_MS_ACCESS,
getDatabaseType(),
E4DBSettings.getDatabaseType()public static int getConnectionCounter()
public java.sql.Connection getConnection()
public void setConnection(java.sql.Connection con)
getConnection(),
setConnection(e4s.db.E4DBConnectionDefault)public void setConnection(E4DBConnectionDefault con)
getConnection()public static void resetConnectionCache()
public static void setAEP(AEP_JDBC_Connection_Intf aep_connection)
public static java.sql.Connection[] getConnectionCache()
public boolean connectionIsPooled()
connectionIsPooled in interface E4DBConnection_IntfE4DBSettings.getPoolingEnabled(java.lang.String)
public void close()
throws E4DBException
close in interface E4DBConnection_IntfE4DBExceptionpublic void finalize()
finalize in class E4Objectpublic java.lang.String toString()
toString in class E4Object
public java.lang.String getCatalog()
throws E4DBException
getCatalog in interface E4DBConnection_IntfE4DBExceptionpublic java.util.Date getCreated()
public static java.lang.String _getSVNVersionString()
E4Util.getRevisionCodeFromSVN(Class)public java.lang.String getID()
getID in interface E4DBConnection_Intf
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||