|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.server.repository.rdb.sql.ServerRdbWrapper
public class ServerRdbWrapper
ServerRdbWrapper provides wrappers around SQL queries and transforms ResultSets into java objects
| Nested Class Summary | |
|---|---|
static class |
ServerRdbWrapper.BatchLockTable
Batch operation for adding parameters to the LockTable prepared statement |
static class |
ServerRdbWrapper.BatchUnlockTable
Batch operation for adding parameters to the UnlockTable prepared statement |
| Field Summary | |
|---|---|
static java.lang.String |
getInitialized
Constant "getInitialized" used to reference prepared statement Server.getInitialized
SELECT INITIALIZED FROM SERVER;
|
static java.lang.String |
getServerId
Constant "getServerId" used to reference prepared statement Server.getServerId
SELECT ID FROM SERVER;
|
static java.lang.String |
lockTable
Constant "lockTable" used to reference prepared statement Server.lockTable
LOCK TABLE ${a} ${b}
|
static java.lang.String |
setInitialized
Constant "setInitialized" used to reference prepared statement Server.setInitialized
UPDATE SERVER SET ID=?,INITIALIZED=1 WHERE INITIALIZED=0;
|
static java.lang.String |
setInitializing
Constant "setInitializing" used to reference prepared statement Server.setInitializing
UPDATE SERVER SET INITIALIZED=0 WHERE INITIALIZED IS NULL
|
static java.lang.String |
setInitializingFailed
Constant "setInitializingFailed" used to reference prepared statement Server.setInitializingFailed
UPDATE SERVER SET INITIALIZED=NULL
|
static java.lang.String |
setServerId
Constant "setServerId" used to reference prepared statement Server.setServerId
UPDATE SERVER SET ID=? WHERE INITIALIZED=1;
|
static java.lang.String |
unlockTable
Constant "unlockTable" used to reference prepared statement Server.unlockTable
EMPTY
|
| Constructor Summary | |
|---|---|
ServerRdbWrapper()
|
|
| Method Summary | |
|---|---|
static java.lang.Long |
getInitialized(PreparedStatementCache sqlCache)
Runs the getInitialized prepared statement. |
static java.lang.Long |
getServerId(PreparedStatementCache sqlCache)
Runs the getServerId prepared statement. |
static void |
lockTable(PreparedStatementCache sqlCache,
java.lang.String tableName,
java.lang.String tableLocksExtra)
Runs the lockTable prepared statement. |
static void |
prepareGetInitialized(java.sql.PreparedStatement ps)
Sets the input parameters for the getInitialized prepared statement. |
static void |
prepareGetServerId(java.sql.PreparedStatement ps)
Sets the input parameters for the getServerId prepared statement. |
static void |
prepareLockTable(java.sql.PreparedStatement ps)
Sets the input parameters for the lockTable prepared statement. |
static void |
prepareSetInitialized(java.sql.PreparedStatement ps,
long id)
Sets the input parameters for the setInitialized prepared statement. |
static void |
prepareSetInitializing(java.sql.PreparedStatement ps)
Sets the input parameters for the setInitializing prepared statement. |
static void |
prepareSetInitializingFailed(java.sql.PreparedStatement ps)
Sets the input parameters for the setInitializingFailed prepared statement. |
static void |
prepareSetServerId(java.sql.PreparedStatement ps,
long id)
Sets the input parameters for the setServerId prepared statement. |
static void |
prepareUnlockTable(java.sql.PreparedStatement ps)
Sets the input parameters for the unlockTable prepared statement. |
static int |
setInitialized(PreparedStatementCache sqlCache,
long id)
Runs the setInitialized prepared statement. |
static int |
setInitializing(PreparedStatementCache sqlCache)
Runs the setInitializing prepared statement. |
static int |
setInitializingFailed(PreparedStatementCache sqlCache)
Runs the setInitializingFailed prepared statement. |
static int |
setServerId(PreparedStatementCache sqlCache,
long id)
Runs the setServerId prepared statement. |
static void |
unlockTable(PreparedStatementCache sqlCache,
java.lang.String tableName)
Runs the unlockTable prepared statement. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String setInitialized
UPDATE SERVER SET ID=?,INITIALIZED=1 WHERE INITIALIZED=0;
public static final java.lang.String setServerId
UPDATE SERVER SET ID=? WHERE INITIALIZED=1;
public static final java.lang.String getServerId
SELECT ID FROM SERVER;
public static final java.lang.String getInitialized
SELECT INITIALIZED FROM SERVER;
public static final java.lang.String setInitializing
UPDATE SERVER SET INITIALIZED=0 WHERE INITIALIZED IS NULL
public static final java.lang.String setInitializingFailed
UPDATE SERVER SET INITIALIZED=NULL
public static final java.lang.String lockTable
LOCK TABLE ${a} ${b}
public static final java.lang.String unlockTable
EMPTY
| Constructor Detail |
|---|
public ServerRdbWrapper()
| Method Detail |
|---|
public static int setInitialized(PreparedStatementCache sqlCache,
long id)
throws AnzoException,
java.sql.SQLException
UPDATE SERVER SET ID=?,INITIALIZED=1 WHERE INITIALIZED=0;
sqlCache - factory and cache of PreparedStatmentsid - template parameter
AnzoException
java.sql.SQLException
public static void prepareSetInitialized(java.sql.PreparedStatement ps,
long id)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are setid - template parameter
java.sql.SQLException
public static int setServerId(PreparedStatementCache sqlCache,
long id)
throws AnzoException,
java.sql.SQLException
UPDATE SERVER SET ID=? WHERE INITIALIZED=1;
sqlCache - factory and cache of PreparedStatmentsid - template parameter
AnzoException
java.sql.SQLException
public static void prepareSetServerId(java.sql.PreparedStatement ps,
long id)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are setid - template parameter
java.sql.SQLException
public static java.lang.Long getServerId(PreparedStatementCache sqlCache)
throws AnzoException,
java.sql.SQLException
SELECT ID FROM SERVER;
sqlCache - factory and cache of PreparedStatments
AnzoException
java.sql.SQLException
public static void prepareGetServerId(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
public static java.lang.Long getInitialized(PreparedStatementCache sqlCache)
throws AnzoException,
java.sql.SQLException
SELECT INITIALIZED FROM SERVER;
sqlCache - factory and cache of PreparedStatments
AnzoException
java.sql.SQLException
public static void prepareGetInitialized(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
public static int setInitializing(PreparedStatementCache sqlCache)
throws AnzoException,
java.sql.SQLException
UPDATE SERVER SET INITIALIZED=0 WHERE INITIALIZED IS NULL
sqlCache - factory and cache of PreparedStatments
AnzoException
java.sql.SQLException
public static void prepareSetInitializing(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
public static int setInitializingFailed(PreparedStatementCache sqlCache)
throws AnzoException,
java.sql.SQLException
UPDATE SERVER SET INITIALIZED=NULL
sqlCache - factory and cache of PreparedStatments
AnzoException
java.sql.SQLException
public static void prepareSetInitializingFailed(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
public static void lockTable(PreparedStatementCache sqlCache,
java.lang.String tableName,
java.lang.String tableLocksExtra)
throws AnzoException,
java.sql.SQLException
LOCK TABLE ${a} ${b}
sqlCache - factory and cache of PreparedStatmentstableName - template parametertableLocksExtra - template parameter
AnzoException
java.sql.SQLException
public static void prepareLockTable(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
public static void unlockTable(PreparedStatementCache sqlCache,
java.lang.String tableName)
throws AnzoException,
java.sql.SQLException
EMPTY
sqlCache - factory and cache of PreparedStatmentstableName - template parameter
AnzoException
java.sql.SQLException
public static void prepareUnlockTable(java.sql.PreparedStatement ps)
throws java.sql.SQLException
ps - PreparedStatement to whose parameters are set
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||