tppt.db
Class SybaseDBLocker
java.lang.Object
|
+--tppt.db.DBLocker
|
+--tppt.db.SybaseDBLocker
- public class SybaseDBLocker
- extends DBLocker
SybaseDBLocker
is the class that is responsbile to obtain and releasse the
Database lock for the single user mode. This class is specific for Sybase only.
- Version:
- 2.0
- Author:
- Jodie Wu
- See Also:
DBLocker
Field Summary |
protected static int |
LOCK_SP_NOT_EXIST
The SQL State Error code: the getDBLock stored procedure does not exist. |
protected static int |
LOCK_TABLE_NOT_EXIST
The SQL State Error code: the Sync table does not exist. |
protected static int |
TABLE_ALREADY_EXIST
The SQL State Error code: the Sync table already exist. |
protected static int |
TABLE_LOCK_INUSE
The SQL State Error code: the Sync table has been locked. |
Method Summary |
static boolean |
getDBLock()
Obtains the Sybase database lock.
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
LOCK_TABLE_NOT_EXIST
protected static final int LOCK_TABLE_NOT_EXIST
- The SQL State Error code: the Sync table does not exist.
TABLE_ALREADY_EXIST
protected static final int TABLE_ALREADY_EXIST
- The SQL State Error code: the Sync table already exist.
TABLE_LOCK_INUSE
protected static final int TABLE_LOCK_INUSE
- The SQL State Error code: the Sync table has been locked.
LOCK_SP_NOT_EXIST
protected static final int LOCK_SP_NOT_EXIST
- The SQL State Error code: the getDBLock stored procedure does not exist.
SybaseDBLocker
public SybaseDBLocker()
- The constructor
getDBLock
public static boolean getDBLock()
- Obtains the Sybase database lock.
It will first try to call the stored procedure getDBLock.
Create the getDBLock stored procedure if it does not exist.
Create the Sync table if it does not exist.
- Returns:
- true if the lock is obtained; false otherwise.
main
public static void main(java.lang.String[] args)