|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.refFaultParamDb.dao.db.DB_ConnectionPool
public class DB_ConnectionPool
DbConnectionBroker A servlet-based broker for database connections. Creates and manages a pool of database connections.
| Field Summary | |
|---|---|
static String |
db_prop_2_file
|
static String |
db_prop_3_ro_file
|
| Fields inherited from interface org.opensha.refFaultParamDb.dao.db.DB_AccessAPI |
|---|
INSERT_UPDATE_QUERY, INSERT_UPDATE_SPATIAL, RESET_PASSWORD, SELECT_QUERY, SELECT_QUERY_SPATIAL, SEQUENCE_NUMBER |
| Constructor Summary | |
|---|---|
DB_ConnectionPool()
|
|
DB_ConnectionPool(String resourceName)
Class default constructor Creates a new Connection Broker after reading the JDBC info from the data file. |
|
DB_ConnectionPool(String resourceName,
String login,
String pass)
Class default constructor Creates a new Connection Broker after reading the JDBC info from the data file, except with the specified username and password. |
|
DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime)
Creates a new Connection Broker dbDriver: JDBC driver. |
|
DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime,
boolean logAppend)
|
|
DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime,
boolean logAppend,
int maxCheckoutSeconds,
int debugLevel)
|
|
| Method Summary | |
|---|---|
static boolean |
authenticateDBConnection(boolean exitOnCancel,
boolean allowReadOnly)
|
void |
destroy()
Less safe shutdown. |
void |
destroy(int millis)
Multi-phase shutdown. |
String |
freeConnection(Connection conn)
Frees a connection. |
long |
getAge(Connection conn)
Returns the age of a connection -- the time since it was handed out to an application. |
Connection |
getConnection()
This method hands out the connections in round-robin order. |
static DB_AccessAPI |
getDB2ReadOnlyConn()
Gets a read only connection to Fault DB version 2 |
static DB_AccessAPI |
getDB2ReadWriteConn()
Gets a read/write capable connection to Fault DB version 2 |
static DB_AccessAPI |
getDB3ReadOnlyConn()
Gets a read only connection to Fault DB version 3 |
static DB_AccessAPI |
getDB3ReadWriteConn()
Gets a read/write capable connection to Fault DB version 3 |
static DB_AccessAPI |
getDirectLatestReadWriteConnection()
|
static DB_AccessAPI |
getLatestReadOnlyConn()
Gets a read only connection to the latest development version of the fault database |
static DB_AccessAPI |
getLatestReadWriteConn()
Gets a read/write capable connection to the latest development version of the fault database |
int |
getNextSequenceNumber(String sequenceName)
Gets the Unique sequence number from Database, so that it can inserted as auto increment number in the data tables. |
int |
getSize()
Returns the number of connections in the dynamic pool. |
String |
getSystemDate()
Get the system date |
int |
getUseCount()
Returns the number of connections in use. |
int |
idOfConnection(Connection conn)
Returns the local JDBC ID for a connection. |
int[] |
insertUpdateOrDeleteBatch(ArrayList<String> sqls,
boolean rollbackOnFail)
Executes a batch of sql statements. |
int |
insertUpdateOrDeleteData(String sql)
Inserts the data into the database |
int |
insertUpdateOrDeleteData(String sql,
ArrayList<oracle.spatial.geometry.JGeometry> geometryList)
Insert/Update/Delete record in the database. |
oracle.jdbc.rowset.OracleCachedRowSet |
queryData(String sql)
Runs the select query on the database |
SpatialQueryResult |
queryData(String sqlWithSpatialColumnNames,
String sqlWithNoSpatialColumnNames,
ArrayList<String> spatialColumnNames)
Query the databse and returns the Results in a object which contains CachedRowSet as well as JGeomtery objects. |
int |
resetPasswordByEmail(String sql)
Reset the password in the database for the provided email address |
void |
run()
Housekeeping thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String db_prop_3_ro_file
public static final String db_prop_2_file
| Constructor Detail |
|---|
public DB_ConnectionPool()
public DB_ConnectionPool(String resourceName)
public DB_ConnectionPool(String resourceName,
String login,
String pass)
public DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime)
throws IOException
IOException
public DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime,
boolean logAppend)
throws IOException
IOException
public DB_ConnectionPool(String dbDriver,
String dbServer,
String dbLogin,
String dbPassword,
int minConns,
int maxConns,
String logFileString,
double maxConnTime,
boolean logAppend,
int maxCheckoutSeconds,
int debugLevel)
throws IOException
IOException| Method Detail |
|---|
public static DB_AccessAPI getDB2ReadOnlyConn()
public static DB_AccessAPI getDB2ReadWriteConn()
public static DB_AccessAPI getDB3ReadOnlyConn()
public static DB_AccessAPI getDB3ReadWriteConn()
public static boolean authenticateDBConnection(boolean exitOnCancel,
boolean allowReadOnly)
public static DB_AccessAPI getLatestReadOnlyConn()
public static DB_AccessAPI getLatestReadWriteConn()
public static DB_AccessAPI getDirectLatestReadWriteConnection()
public void run()
run in interface Runnablepublic Connection getConnection()
public int idOfConnection(Connection conn)
public String freeConnection(Connection conn)
public long getAge(Connection conn)
public void destroy(int millis)
throws SQLException
getConnection() will refuse to return connections.
millis milliseconds after shutdown of
the housekeeping thread, freeConnection() can still be
called to return used connections.
millis milliseconds after the shutdown of the
housekeeping thread, all connections in the pool are closed.
SQLException is thrown.
destroy in interface DB_AccessAPImillis - the time to wait in milliseconds.
SQLException - if connections were in use after
millis.public void destroy()
destroy() method
with a millis
value of 10000 (10 seconds) and ignores SQLException
thrown by that method.
destroy in interface DB_AccessAPIdestroy(int)public int getUseCount()
public int getSize()
public int resetPasswordByEmail(String sql)
throws SQLException
resetPasswordByEmail in interface DB_AccessAPIsql - email -
SQLException
public int insertUpdateOrDeleteData(String sql)
throws SQLException
insertUpdateOrDeleteData in interface DB_AccessAPIquery -
SQLException
public int[] insertUpdateOrDeleteBatch(ArrayList<String> sqls,
boolean rollbackOnFail)
throws SQLException
DB_AccessAPI
insertUpdateOrDeleteBatch in interface DB_AccessAPISQLException
public String getSystemDate()
throws SQLException
getSystemDate in interface DB_AccessAPISQLException
public int getNextSequenceNumber(String sequenceName)
throws SQLException
getNextSequenceNumber in interface DB_AccessAPIsequenceName - String
SQLException
public oracle.jdbc.rowset.OracleCachedRowSet queryData(String sql)
throws SQLException
queryData in interface DB_AccessAPIquery -
SQLException
public SpatialQueryResult queryData(String sqlWithSpatialColumnNames,
String sqlWithNoSpatialColumnNames,
ArrayList<String> spatialColumnNames)
throws SQLException
queryData in interface DB_AccessAPIsql - String
SQLException
public int insertUpdateOrDeleteData(String sql,
ArrayList<oracle.spatial.geometry.JGeometry> geometryList)
throws SQLException
insertUpdateOrDeleteData in interface DB_AccessAPIsql - String
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||