public class DBConnector
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
DBConnector.DBPreparedBatchEntry |
Constructor | Description |
---|---|
DBConnector() |
|
DBConnector(java.lang.String dbClass,
java.lang.String dbService,
java.lang.String dbUser,
java.lang.String dbPass,
java.util.Map<java.lang.String,java.lang.String> dbParms,
int numConnections,
int dbPingIntMins,
boolean reuse,
boolean transact,
boolean doErrorQueueing,
boolean retryErrorQueue) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
amIOk() |
Return the happiness level of the connections
Usage: amIOk()
|
void |
DBDone(DBConnection D) |
Return a DBConnection object fetched with DBFetch()
Usage:
|
DBConnection |
DBFetch() |
Fetch a single, not in use DBConnection object.
|
DBConnection |
DBFetchEmpty() |
Fetch a single, not in use DBConnection object.
|
DBConnection |
DBFetchPrepared(java.lang.String SQL) |
Fetch a single, not in use DBConnection object.
|
DBConnection |
DBFetchTest() |
Fetch a single, not in use DBConnection object for testing only.
|
boolean |
deregisterDriver() |
|
void |
enQueueError(java.lang.String SQLString,
java.lang.String SQLError,
java.lang.String count) |
Queue up a failed write/update for later processing.
|
java.lang.StringBuffer |
errorStatus() |
return a status string, or "" if everything is ok.
|
long |
getLongRes(java.sql.ResultSet Results,
java.lang.String Field) |
When reading a database table, this routine will read in
the given Field NAME, returning the value.
|
int |
getRecordCount(DBConnection D,
java.sql.ResultSet R) |
|
java.lang.String |
getRes(java.sql.ResultSet Results,
int One) |
When reading a database table, this routine will read in
the given One index number, returning the value.
|
java.lang.String |
getRes(java.sql.ResultSet Results,
java.lang.String Field) |
When reading a database table, this routine will read in
the given Field NAME, returning the value.
|
java.lang.String |
getResQuietly(java.sql.ResultSet Results,
java.lang.String Field) |
|
java.lang.String |
injectionClean(java.lang.String s) |
|
boolean |
isFakeDB() |
|
void |
killConnections() |
Destroy all database connections, effectively
shutting down this class.
|
void |
listConnections(java.io.PrintStream out) |
list the connections
Usage: listConnections(out);
|
int |
numConnectionsMade() |
|
int |
numDBConnectionsInUse() |
|
int |
pingAllConnections(java.lang.String querySql) |
Pings all connections
|
int |
pingAllConnections(java.lang.String querySql,
long overridePingIntMillis) |
Pings all connections
|
int |
queryRows(java.lang.String queryString) |
|
void |
reconnect() |
|
void |
retryQueuedErrors() |
Queue up a failed write/update for later processing.
|
java.lang.String |
service() |
|
int |
update(java.lang.String updateString) |
|
int |
update(java.lang.String[] updateStrings) |
|
int |
updateWithClobs(DBConnector.DBPreparedBatchEntry entry) |
|
int |
updateWithClobs(java.lang.String[] updateStrings,
java.lang.String[][][] values) |
|
int |
updateWithClobs(java.lang.String updateString,
java.lang.String... values) |
|
int |
updateWithClobs(java.lang.String updateString,
java.lang.String[][] values) |
|
int |
updateWithClobs(java.util.List<DBConnector.DBPreparedBatchEntry> entries) |
|
boolean |
useBulkInserts() |
public DBConnector()
public DBConnector(java.lang.String dbClass, java.lang.String dbService, java.lang.String dbUser, java.lang.String dbPass, java.util.Map<java.lang.String,java.lang.String> dbParms, int numConnections, int dbPingIntMins, boolean reuse, boolean transact, boolean doErrorQueueing, boolean retryErrorQueue)
public void reconnect()
public java.lang.String service()
public boolean useBulkInserts()
public int getRecordCount(DBConnection D, java.sql.ResultSet R)
public boolean deregisterDriver()
public boolean isFakeDB()
public int update(java.lang.String[] updateStrings)
public int update(java.lang.String updateString)
public int updateWithClobs(java.lang.String[] updateStrings, java.lang.String[][][] values)
public int updateWithClobs(java.util.List<DBConnector.DBPreparedBatchEntry> entries)
public int updateWithClobs(DBConnector.DBPreparedBatchEntry entry)
public int updateWithClobs(java.lang.String updateString, java.lang.String... values)
public int updateWithClobs(java.lang.String updateString, java.lang.String[][] values)
public int queryRows(java.lang.String queryString)
public DBConnection DBFetch()
public DBConnection DBFetchTest()
public DBConnection DBFetchEmpty()
public int numConnectionsMade()
public int numDBConnectionsInUse()
public DBConnection DBFetchPrepared(java.lang.String SQL)
SQL
- The prepared statement SQLpublic void DBDone(DBConnection D)
D
- The Database connection to return to the poolpublic java.lang.String getRes(java.sql.ResultSet Results, java.lang.String Field)
Results
- The ResultSet object to useField
- Field name to returnpublic java.lang.String getResQuietly(java.sql.ResultSet Results, java.lang.String Field)
public java.lang.String injectionClean(java.lang.String s)
public long getLongRes(java.sql.ResultSet Results, java.lang.String Field)
Results
- The ResultSet object to useField
- Field name to returnpublic java.lang.String getRes(java.sql.ResultSet Results, int One)
Results
- The ResultSet object to useOne
- Field number to returnpublic void killConnections()
public boolean amIOk()
public int pingAllConnections(java.lang.String querySql)
querySql
- the query to ping withpublic int pingAllConnections(java.lang.String querySql, long overridePingIntMillis)
querySql
- the query to ping withoverridePingIntMillis
- the age of a connection before a ping is necessarypublic void enQueueError(java.lang.String SQLString, java.lang.String SQLError, java.lang.String count)
SQLString
- UPDATE style SQL statementSQLError
- The error message being reportedcount
- The number of tries so farpublic void retryQueuedErrors()
public void listConnections(java.io.PrintStream out)
out
- place to send the list out topublic java.lang.StringBuffer errorStatus()