com.wm.app.tn.db
Class Datastore

java.lang.Object
  extended by com.wm.app.tn.db.Datastore

public class Datastore
extends java.lang.Object

Main entry point for getting connections to the store database. This allows us to do our own connection pooling.


Field Summary
static int DBTYPE
           
static int DBTYPE_DB2
           
static int DBTYPE_ORA
           
static int DBTYPE_SQLS
           
static int DBTYPE_SYBASE
           
static java.lang.String PROP_DBG
           
static java.lang.String PROP_LOGSQL
           
static java.lang.String PROP_POOLSTMT
           
static java.lang.String PROP_TRC
           
static java.lang.String resolvedDB
           
 
Constructor Summary
Datastore()
           
 
Method Summary
static void checkAndLoadInitXML()
           
static java.sql.Connection getConnection()
          Gets a connection from the global database connection pool.
static java.util.Locale getLocale()
          For internal use only
static com.wm.data.IData getPoolInfo()
           
static com.wm.jdbc.IJDBCConnPool getTNPool()
          For internal use only
static int[] getVersion()
           
static java.sql.Connection handleSQLException(java.sql.Connection conn, java.lang.Throwable t)
          For internal use only
static void init(java.io.File srv_dir, java.util.Locale loc)
          For internal use only
static boolean isArchivingEnabled()
           
static boolean isEmbedded()
           
static boolean isInitialized()
          For internal use only
static boolean isOffLine()
          For internal use only
static void releaseConnection(java.sql.Connection conn)
          Release a connection back to the pool.
static void setArchivingEnabled()
           
static void setOffLine(boolean mode)
          For internal use only
static boolean setVersion(int major, int minor)
          For internal use only
static void shutdown()
          For internal use only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DBG

public static final java.lang.String PROP_DBG
See Also:
Constant Field Values

PROP_TRC

public static final java.lang.String PROP_TRC
See Also:
Constant Field Values

PROP_POOLSTMT

public static final java.lang.String PROP_POOLSTMT
See Also:
Constant Field Values

PROP_LOGSQL

public static final java.lang.String PROP_LOGSQL
See Also:
Constant Field Values

DBTYPE_ORA

public static final int DBTYPE_ORA
See Also:
Constant Field Values

DBTYPE_SQLS

public static final int DBTYPE_SQLS
See Also:
Constant Field Values

DBTYPE_SYBASE

public static final int DBTYPE_SYBASE
See Also:
Constant Field Values

DBTYPE_DB2

public static final int DBTYPE_DB2
See Also:
Constant Field Values

DBTYPE

public static int DBTYPE

resolvedDB

public static java.lang.String resolvedDB
Constructor Detail

Datastore

public Datastore()
Method Detail

init

public static void init(java.io.File srv_dir,
                        java.util.Locale loc)
                 throws DatastoreException
For internal use only

Throws:
DatastoreException

shutdown

public static void shutdown()
For internal use only


isEmbedded

public static boolean isEmbedded()
Returns:
are we using the embedded DB?

getVersion

public static int[] getVersion()
Returns:
data model version ( { major, minor } )

setVersion

public static boolean setVersion(int major,
                                 int minor)
                          throws java.sql.SQLException
For internal use only

Throws:
java.sql.SQLException

setOffLine

public static void setOffLine(boolean mode)
For internal use only


isOffLine

public static boolean isOffLine()
For internal use only


getConnection

public static final java.sql.Connection getConnection()
                                               throws java.sql.SQLException
Gets a connection from the global database connection pool. If no connections are available, this method will block until one is returned to the pool.

Throws:
java.sql.SQLException

releaseConnection

public static void releaseConnection(java.sql.Connection conn)
Release a connection back to the pool.

Parameters:
conn - the connection to return

getLocale

public static java.util.Locale getLocale()
For internal use only


isInitialized

public static boolean isInitialized()
For internal use only


getTNPool

public static com.wm.jdbc.IJDBCConnPool getTNPool()
For internal use only


getPoolInfo

public static com.wm.data.IData getPoolInfo()

handleSQLException

public static java.sql.Connection handleSQLException(java.sql.Connection conn,
                                                     java.lang.Throwable t)
For internal use only


checkAndLoadInitXML

public static void checkAndLoadInitXML()
                                throws DatastoreException
Throws:
DatastoreException

isArchivingEnabled

public static boolean isArchivingEnabled()

setArchivingEnabled

public static void setArchivingEnabled()