|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--zeta.util.DatabaseUtils
Provides database utilities especially for the servlets.
| Field Summary | |
private static long |
DB2_DAYS_MILLIS_DIFF
|
private static int |
numberOfServers
|
| Constructor Summary | |
DatabaseUtils()
|
|
| Method Summary | |
static void |
close(java.sql.Connection con)
Releases a connection's database and JDBC resources immediately instead of waiting for them to be automatically released. |
static void |
close(java.sql.Statement stmt)
Releases a statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. |
static long |
convertDaysToTimeMillis(long days)
Converts days to time millis. |
static long |
convertTimeMillisToDays(long timeMillis)
Converts days to time millis. |
static void |
db2CLP(java.lang.String db2)
Executes the Command Line Processor. |
static java.lang.String |
encodeName(java.lang.String name)
Encodes a name so that it can be stored in the database. |
static void |
executeAndLogUpdate(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement)
Executing and logging a SQL statement in the database to synchronize different servers. |
static void |
executeAndLogUpdate(ZetaServlet servlet,
java.lang.String sqlStatement)
Executing and logging a SQL statement in the database to synchronize different servers. |
private static java.lang.String |
getLogStatement(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement,
java.lang.StringBuffer buffer)
Generates logging statements. |
static java.lang.String |
log(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement)
Logging SQL statements in the database to synchronize different servers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static int numberOfServers
private static final long DB2_DAYS_MILLIS_DIFF
| Constructor Detail |
public DatabaseUtils()
| Method Detail |
public static void close(java.sql.Connection con)
con - the connection to the databasepublic static void close(java.sql.Statement stmt)
stmt - statement object's database
public static java.lang.String log(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement)
throws java.sql.SQLException
serverId - ID of the serverstmt - statement object's databasesqlStatement - SQL statement which should be logged
java.sql.SQLException - if a database access error occurs.
public static void executeAndLogUpdate(ZetaServlet servlet,
java.lang.String sqlStatement)
throws java.sql.SQLException,
javax.servlet.ServletException
servlet - servlet which has a connection to the server database.sqlStatement - SQL statement which should be logged
java.sql.SQLException - if a database access error occurs.
javax.servlet.ServletException
public static void executeAndLogUpdate(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement)
throws java.sql.SQLException
serverId - ID of the serverstmt - statement object's databasesqlStatement - SQL statement which should be logged
java.sql.SQLException - if a database access error occurs.public static java.lang.String encodeName(java.lang.String name)
name - name to be encoded
public static void db2CLP(java.lang.String db2)
throws java.io.IOException
db2 - DB2 commands which will be sent to the Command Line Processor.
java.io.IOExceptionpublic static long convertDaysToTimeMillis(long days)
days - days
public static long convertTimeMillisToDays(long timeMillis)
private static java.lang.String getLogStatement(int serverId,
java.sql.Statement stmt,
java.lang.String sqlStatement,
java.lang.StringBuffer buffer)
serverId - ID of the serverstmt - statement object's databasesqlStatement - SQL statement which should be logged
|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||