|
||||||||||
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 |
deleteCollection(DCCollection collection,
RequestorCollection requestors)
Deletes a collection of data crow objects from the database |
void |
deleteValues(DCObject o,
RequestorCollection requestors)
Deletes values from the database. |
void |
init()
Starts the query queue and initializes the database connection |
void |
insertCollection(DCCollection collection,
RequestorCollection requestors)
Inserts a collection of data crow objects into the database |
void |
insertValues(DCObject o,
RequestorCollection requestors)
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.sql.ResultSet |
runQueryDirectUnclosed(java.lang.String sQuery)
Runs a query direct on the database instead of putting it in query queue. |
void |
searchValues(DCObject o,
QueryOptions options,
RequestorCollection requestors)
Searches for values. |
boolean |
uniqueValues(DCObject o,
boolean bUpdateQuery)
Checks whether the values are unique (do not exist as yet in the database). |
void |
updateCollection(DCCollection collection,
RequestorCollection requestors)
Updates a collection of data crow objects |
void |
updateValues(DCObject o,
RequestorCollection requestors)
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 insertCollection(DCCollection collection, RequestorCollection requestors)
collection
- data crow object collectionrequestors
- requests to be executed after insertpublic void updateCollection(DCCollection collection, RequestorCollection requestors)
collection
- data crow object collectionrequestors
- requests to be executed after updatepublic void deleteCollection(DCCollection collection, RequestorCollection requestors)
collection
- data crow object collectionrequestors
- requests to be executed after deletepublic 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) throws java.lang.Exception
sQuery
- query to be executed
java.lang.Exception
public java.util.LinkedList runQueryDirect(java.lang.String sQuery)
sQuery
- query statement
public java.util.LinkedList runQueryDirect(DCObject o)
public java.util.LinkedList runQueryDirect(Query query)
public void searchValues(DCObject o, QueryOptions options, RequestorCollection requestors)
o
- the object which is used as the conditionoptions
- query optionsrequestors
- requestors for the result of the query (UI)public void updateValues(DCObject o, RequestorCollection requestors)
o
- the object to be updatedrequestors
- requestors which depend on the outcome of the querypublic void insertValues(DCObject o, RequestorCollection requestors)
o
- the object to be insertedrequestors
- requestors which depend on the outcome of the querypublic void deleteValues(DCObject o, RequestorCollection requestors)
o
- the object to be deletedrequestors
- requestors which depend on the outcome of the querypublic 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 |