public class DatabaseSystem
extends java.lang.Object
DatabaseSystem
class controls a database system.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
databaselogname |
static java.lang.String |
databaselognameext |
Constructor and Description |
---|
DatabaseSystem(java.util.Properties n4edb,
java.lang.String databaseSystem,
java.lang.String propName,
java.lang.String path_to_log,
java.lang.String log_path_old)
The constructor
DatabaseSystem creates a new instance(object) of the class. |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(java.io.File sourceFile,
java.io.File destFile)
The method
copyFile performs a copy with help from java
system. |
static void |
copyFileOsWindows(java.lang.String commandInt,
java.lang.String log_path,
java.lang.String logTo,
java.lang.String logrenname)
Deprecated.
since 22.2.2010, t.k.
|
void |
flushLog()
The method
flushLog clears the batch log file and writes last lines. |
DatabaseConnectionSet |
getDatabaseConnectionSet()
get field: the current database connection set.
|
java.lang.String |
getDatabaseUrl()
get field: the current url of the database system.
|
java.lang.String |
getDatabaseUser()
get field: the name of the autorized user for access to the database system.
|
java.lang.String |
getDatabaseUserPassword()
get field: the password of the autorized user for access to the database system.
|
java.lang.String |
getDbmsName()
get field: the technical name of the database system.
|
int |
getDbSystemCode()
get field: type of dbms.
|
int |
getDbSystemType()
get field: constant internal code for a n4e database system.
|
java.lang.String |
getDbTypeName()
get field: the n4e type of the database system.
|
boolean |
getDebugConn()
get field: debug mode for connection using.
|
java.lang.String |
getDriverClass()
get field: the java name of the class of the current driver (dbms dependent).
|
int |
getIncConn()
get field: increment for connection creating.
|
java.lang.String |
getLogNameAdd()
get field: the log name add of the database system.
|
int |
getMaxConn()
get field: max count for connection creating.
|
java.lang.String |
getProtocol()
get field: the tables, which protocol their traffic.
|
boolean |
getSqlreport()
get field: true = log the current sql statement to the log file of the database system (for debugging).
|
java.lang.String |
getSystemName()
get field: the name of the database system.
|
boolean |
getValidateConn()
get field: validate a connection before using.
|
java.io.PrintWriter |
getWriter4DatabaseLog()
get field: the writer object for the log file of the database system.
|
java.lang.String |
report4DatabaseSystem(boolean dolog,
boolean web)
The method
report4DatabaseSystem creates a log of status of database system. |
static void |
saveOldLog(java.lang.String path_to_log,
java.lang.String log_path_old,
java.lang.String systemlogname,
java.lang.String systemlognameext)
The method
saveOldLog copys the current log files into directories. |
void |
setDatabaseConnectionSet(DatabaseConnectionSet input)
set field: the current database connection set.
|
void |
write2Log(java.lang.String message)
The method
write2Log writes a message to batch log file. |
void |
writeLine2Log(java.lang.String message)
The method
writeLine2Log writes a message line to batch log file. |
public static final java.lang.String databaselognameext
public static final java.lang.String databaselogname
public DatabaseSystem(java.util.Properties n4edb, java.lang.String databaseSystem, java.lang.String propName, java.lang.String path_to_log, java.lang.String log_path_old) throws java.lang.Exception
DatabaseSystem
creates a new instance(object) of the class.n4edb
- properties file of current database system.databaseSystem
- name of current database system.propName
- name of properties fiels.path_to_log
- path of file system to log to.log_path_old
- path of the old database logs.java.lang.Exception
- if errorpublic int getDbSystemCode()
public int getDbSystemType()
public java.lang.String getSystemName()
public java.lang.String getDbTypeName()
public java.lang.String getDbmsName()
public java.lang.String getDriverClass()
public void setDatabaseConnectionSet(DatabaseConnectionSet input)
input
- database connection setpublic DatabaseConnectionSet getDatabaseConnectionSet()
public java.lang.String getDatabaseUrl()
public java.lang.String getDatabaseUser()
public java.lang.String getDatabaseUserPassword()
public boolean getValidateConn()
public boolean getDebugConn()
public int getMaxConn()
public int getIncConn()
public boolean getSqlreport()
public java.io.PrintWriter getWriter4DatabaseLog()
public java.lang.String getLogNameAdd()
public java.lang.String getProtocol()
public void write2Log(java.lang.String message) throws java.lang.Exception
write2Log
writes a message to batch log file.message
- the message.java.lang.Exception
- if errorpublic void writeLine2Log(java.lang.String message) throws java.lang.Exception
writeLine2Log
writes a message line to batch log file.message
- the message line.java.lang.Exception
- if errorpublic void flushLog() throws java.lang.Exception
flushLog
clears the batch log file and writes last lines.java.lang.Exception
- if errorpublic java.lang.String report4DatabaseSystem(boolean dolog, boolean web) throws java.lang.Exception
report4DatabaseSystem
creates a log of status of database system.dolog
- true: log to system log.web
- true: create web output.java.lang.Exception
- if errorpublic static void saveOldLog(java.lang.String path_to_log, java.lang.String log_path_old, java.lang.String systemlogname, java.lang.String systemlognameext) throws java.lang.Exception
saveOldLog
copys the current log files into directories.path_to_log
- path of file system to log to.log_path_old
- path of the old database logs.systemlogname
- name of log file.systemlognameext
- extention of log file.java.lang.Exception
- if errorpublic static void copyFileOsWindows(java.lang.String commandInt, java.lang.String log_path, java.lang.String logTo, java.lang.String logrenname) throws java.lang.Exception
copyFileOsWindows
performs a copy with help from operating system.commandInt
- the command interpreter.log_path
- the path of files.logTo
- path for copy to.logrenname
- name of log file.java.lang.Exception
- if errorpublic static void copyFile(java.io.File sourceFile, java.io.File destFile) throws java.io.IOException
copyFile
performs a copy with help from java
system.sourceFile
- the source file.destFile
- destination file.java.io.IOException
- if error