|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--suncertify.client.QueryInterfaceWrapper
The Class is responsible for database access. It may work in two modes ALONE and CLIENT that is local and remote respectively. It hides all detail like poping-up information window, exception and error handling so it allows for easy data base operation excution from the client GUI. As db access methods may hung (e.g. lock, update as far as remote invocations) they are executed in a new thread (see concreat method descrition for details).
LoggerSupport, in local mode the QueryInterfaceImpl class requires the log method to log dataBase events, it is not used in remote version as the server logs database events
Field Summary | |
static int |
ALONE
one of the possible working mode - the local one |
static int |
CLIENT
one of the possible working mode - the remote one |
Constructor Summary | |
QueryInterfaceWrapper(int mode,
javax.swing.JFrame frame)
The constructor inicialize the QueryInterfaceWrapper instance with mode to work in (local or remote), a reference to the parent frame object is also required for pop-ups window. |
Method Summary | |
boolean |
checkConnected()
|
void |
create(java.lang.String[] data)
Asynchronous create invocation. |
boolean |
dbConnect()
Method establishe the connection with dataBase.. |
void |
dbDisconnect()
Disconnect from the database. |
void |
delete(int recordId)
Asynchronous delete invocation. |
int[] |
find(java.lang.String[] criteria)
Synchronous find method. |
void |
isLocked(int recordId)
Asynchronous isLocked method invocation. |
void |
lock(int recordId)
Asynchronous lock method invocation. |
void |
log(java.lang.String text)
Log method requierd buy the LoggableInterface, in local mode the QueryInterfaceImpl class requires the log method to log dataBase events, it is not used in remote version as server logs database events |
java.lang.String[] |
read(int rowId)
Synchronous read method. |
void |
unlock(int recordId)
Asynchronous unlock method invocation. |
void |
update(int rowId,
java.lang.String[] data)
Asynchronous update invocation. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALONE
public static final int CLIENT
Constructor Detail |
public QueryInterfaceWrapper(int mode, javax.swing.JFrame frame)
mode
- - the mode in which intance is supposed to workframe
- - reference to the main fram of the applicationMethod Detail |
public boolean dbConnect()
QueryInterface.logIn(String)
,
QueryInterface.logIn()
public void dbDisconnect()
QueryInterface.logOut(String)
,
QueryInterfaceImpl.closeDB()
public int[] find(java.lang.String[] criteria)
criteria
- the search criteria
QueryInterface.find(String[], String)
public java.lang.String[] read(int rowId)
rowId
- the id of requested record
QueryInterface.read(int, String)
public void delete(int recordId)
recordId
- the id of record to deleteQueryInterface.delete(int, String)
public void update(int rowId, java.lang.String[] data)
data
- new data for the recordQueryInterface.update(int, String[], String)
public void create(java.lang.String[] data)
data
- data for the new recordQueryInterface.create(String[], String)
public void isLocked(int recordId)
recordId
- the id of record to ask forQueryInterface.isLocked(int, String)
public void lock(int recordId)
recordId
- the id of record to ask forQueryInterface.lock(int, String)
public void unlock(int recordId)
recordId
- the id of record to ask forQueryInterface.unlock(int, String)
public boolean checkConnected()
public void log(java.lang.String text)
log
in interface LoggerSupport
text
- to be logged
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |