|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.dc.db.Database
Holder of the Database connection and information. Starts the QueryQueue and handles update, insert and select statements. On the first start, the Database will be created (if the database is empty; the tables do not exist). If this fails, a message is shown to the user. For new records, the unique ID is created by this class. This has not been perfected at this moment.
Constructor Summary | |
Database()
Initializes the Database, creates a new database if necessary |
Method Summary | |
static void |
close()
Closes the database connection |
void |
deleteValues(DCObject o)
Deletes values from the database. |
void |
init()
Starts the query queue and initializes the database connection |
void |
insertValues(DCObject o)
Inserts new values. |
void |
runQuery(java.lang.String sQuery,
RequestorCollection requestors)
Runs a query |
java.util.LinkedList |
runQueryDirect(DCObject o)
Runs a query directly, bypassing the query queue |
java.util.LinkedList |
runQueryDirect(Query query)
Does not put the query in a queue but executes it immediately. |
java.util.LinkedList |
runQueryDirect(java.lang.String sQuery)
Does not put the query in a queue but executes it immediately. |
java.util.LinkedList |
runQueryDirect(java.lang.String sQuery,
boolean catchErrors)
Does not put the query in a queue but executes it immediately. |
java.sql.ResultSet |
runQueryDirectUnclosed(java.lang.String sQuery,
boolean silent)
Runs a query direct on the database instead of putting it in query queue. |
void |
searchValues(DCObject o,
QueryOptions options)
Searches for values. |
boolean |
uniqueValues(DCObject o,
boolean bUpdateQuery)
Checks whether the values are unique (do not exist as yet in the database). |
void |
updateValues(DCObject o)
Updates values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Database()
Method Detail |
public static void close()
public void init()
DatabaseConnection
,
QueryQueue
public void runQuery(java.lang.String sQuery, RequestorCollection requestors)
sQuery
- query statement (string)requestors
- requests to the UIpublic java.sql.ResultSet runQueryDirectUnclosed(java.lang.String sQuery, boolean silent) throws java.lang.Exception
sQuery
- query to be executed
java.lang.Exception
public java.util.LinkedList runQueryDirect(java.lang.String sQuery, boolean catchErrors) throws java.lang.Exception
sQuery
- query statementcatchErrors
- indicates whether errors should be caugth or passed on
to the caller
java.lang.Exception
public java.util.LinkedList runQueryDirect(java.lang.String sQuery)
sQuery
- query statement
public java.util.LinkedList runQueryDirect(DCObject o)
o
- data crow objectpublic java.util.LinkedList runQueryDirect(Query query)
query
- Query objectpublic void searchValues(DCObject o, QueryOptions options)
o
- the object which is used as the conditionoptions
- query optionspublic void updateValues(DCObject o)
o
- the object to be updatedpublic void insertValues(DCObject o)
o
- the object to be insertedpublic void deleteValues(DCObject o)
o
- the object to be deletedpublic boolean uniqueValues(DCObject o, boolean bUpdateQuery)
o
- object to be checkedbUpdateQuery
- specifies whether this is an update or an insert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |