|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.core.database.DBConnections
public class DBConnections
| Field Summary | |
|---|---|
protected java.util.Vector |
Connections
the database connnections |
protected int |
consecutiveErrors
the number of times the system has failed a request |
protected int |
consecutiveFailures
the number of times the system has failed to get a db |
protected java.lang.String |
DBClass
|
protected java.lang.String |
DBPass
the odbc password |
protected java.lang.String |
DBService
the odbc service |
protected java.lang.String |
DBUser
the odbc login user |
protected boolean |
disconnected
the disconnected flag |
protected boolean |
errorQueingEnabled
Object to synchronize around on error handling |
protected boolean |
lockedUp
the im in trouble flag |
protected int |
maxConnections
number of connections to make |
protected boolean |
reuse
whether to reuse connections |
protected boolean |
YOU_ARE_DONE
set this to true once, cuz it makes it all go away. |
| Constructor Summary | |
|---|---|
DBConnections(java.lang.String NEWDBClass,
java.lang.String NEWDBService,
java.lang.String NEWDBUser,
java.lang.String NEWDBPass,
int NEWnumConnections,
boolean NEWreuse,
boolean DoErrorQueueing)
Initialize this class. |
|
| Method Summary | |
|---|---|
boolean |
amIOk()
Return the happiness level of the connections Usage: amIOk() |
void |
clearErrors()
|
void |
DBDone(DBConnection D)
Return a DBConnection object fetched with DBFetch() Usage: |
DBConnection |
DBFetch()
Fetch a single, not in use DBConnection object. |
DBConnection |
DBFetchAny(java.lang.String SQL,
boolean prepared)
Fetch a single, not in use DBConnection object. |
DBConnection |
DBFetchPrepared(java.lang.String SQL)
|
boolean |
deregisterDriver()
|
void |
enQueueError(java.lang.String SQLString,
java.lang.String SQLError,
java.lang.String tries)
Queue up a failed write/update for later processing. |
java.lang.StringBuffer |
errorStatus()
return a status string, or "" if everything is ok. |
static 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. |
static 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. |
static 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. |
static java.lang.String |
getResQuietly(java.sql.ResultSet Results,
java.lang.String Field)
|
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()
Return the number of connections made. |
int |
numInUse()
|
int |
queryRows(java.lang.String queryString)
Usage: update("UPDATE..."); |
void |
reportError()
|
void |
resetConnections()
|
void |
retryQueuedErrors()
Queue up a failed write/update for later processing. |
int |
update(java.lang.String updateString)
Usage: update("UPDATE..."); |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String DBClass
protected java.lang.String DBService
protected java.lang.String DBUser
protected java.lang.String DBPass
protected int maxConnections
protected boolean disconnected
protected boolean lockedUp
protected int consecutiveFailures
protected int consecutiveErrors
protected boolean errorQueingEnabled
protected java.util.Vector Connections
protected boolean YOU_ARE_DONE
protected boolean reuse
| Constructor Detail |
|---|
public DBConnections(java.lang.String NEWDBClass,
java.lang.String NEWDBService,
java.lang.String NEWDBUser,
java.lang.String NEWDBPass,
int NEWnumConnections,
boolean NEWreuse,
boolean DoErrorQueueing)
NEWDBClass - the odbc serviceNEWDBService - the odbc serviceNEWDBUser - the odbc user loginNEWDBPass - the odbc user passwordNEWnumConnections - Connections to maintainNEWreuse - Whether to reuse connectionsDoErrorQueueing - whether to save errors to a file| Method Detail |
|---|
public int update(java.lang.String updateString)
updateString - the update SQL command
public int numConnectionsMade()
public int numInUse()
public DBConnection DBFetch()
public DBConnection DBFetchAny(java.lang.String SQL,
boolean prepared)
SQL - The prepared statement SQLprepared - whether the statement should be a prepared one
public DBConnection DBFetchPrepared(java.lang.String SQL)
public void DBDone(DBConnection D)
D - The Database connection to return to the pool
public static java.lang.String getRes(java.sql.ResultSet Results,
java.lang.String Field)
Results - The ResultSet object to useField - Field name to return
public static long getLongRes(java.sql.ResultSet Results,
java.lang.String Field)
Results - The ResultSet object to useField - Field name to return
public static java.lang.String getRes(java.sql.ResultSet Results,
int One)
Results - The ResultSet object to useOne - Field number to return
public static java.lang.String getResQuietly(java.sql.ResultSet Results,
java.lang.String Field)
public boolean deregisterDriver()
public void resetConnections()
public void killConnections()
public boolean amIOk()
public void enQueueError(java.lang.String SQLString,
java.lang.String SQLError,
java.lang.String tries)
SQLString - UPDATE style SQL statementSQLError - The error message being reportedtries - The number of tries to redo it so farpublic void retryQueuedErrors()
public int queryRows(java.lang.String queryString)
queryString - the update SQL command
public void listConnections(java.io.PrintStream out)
out - place to send the list out topublic void reportError()
public void clearErrors()
public java.lang.StringBuffer errorStatus()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||