|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kotkabeans.DB
provides a connection to the Kotka database to the other beans.
Field Summary | |
protected int |
concurType
|
protected java.util.Date |
connecttime
|
protected java.lang.String |
createStack
|
static boolean |
doLog
|
protected static int |
driverLoaded
|
protected static int |
laskuri
|
protected java.lang.String |
lastSQL
|
protected Log.NamedLog |
logConn
|
protected Log.NamedLog |
logConnMid
|
protected Log.NamedLog |
logQuery
|
protected java.sql.Connection |
myconn
Stores used database connection. if null, connect() -method
is called when one tries to use database-oriented methods. |
protected int |
scrollType
|
protected java.sql.Statement |
stmt
Used to carry out database operations. |
protected boolean |
transaction
Set to true if transaction has been started. |
protected int |
transactionIsolationLevel
|
Constructor Summary | |
DB()
|
|
DB(java.lang.String cname)
|
Method Summary | |
void |
abortTransaction()
Flushes transaction-buffer without executing commands. |
void |
addBatch(java.lang.String sqlSentence)
|
void |
beginTransaction()
Starts collecting SQL-commands to buffer, which are executed later as a single block. |
void |
connect()
Requests connection to the Kotka-database. |
static int |
connectionCount()
|
protected void |
decConn()
|
void |
disconnect()
Releases used connection. |
void |
elog(Log.NamedLog logger,
java.lang.String method,
java.lang.String sentence)
|
void |
elog(java.lang.String method,
java.lang.String sentence)
|
void |
endTransaction()
Executes SQL-commands from buffer created by beginTransaction() -method.
|
int[] |
executeBatch()
|
java.sql.ResultSet |
executeQuery(java.lang.String sqlSentence)
Executes SQL-query and establishes connection if needed. |
int |
executeUpdate(java.lang.String sqlSentence)
Executes SQL-update and registeres it to the log file. |
protected void |
finalize()
|
static int |
getID()
|
java.sql.DatabaseMetaData |
getMetaData()
|
int |
getTransactionIsolationLevel()
|
protected void |
incConn()
|
boolean |
isConnected()
|
protected java.sql.Connection |
loadDriver(int connectionType)
Loads database driver and establishes connection to database |
void |
log(Log.NamedLog logger,
java.lang.String sentence)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Prepares statment with parameters marked as ? |
void |
setConcurType(int newType)
|
void |
setScrollType(int newType)
|
void |
setTransactionIsolationLevel(int level)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static int laskuri
protected static int driverLoaded
protected java.util.Date connecttime
protected java.lang.String lastSQL
protected java.lang.String createStack
protected java.sql.Connection myconn
null, connect()
-method
is called when one tries to use database-oriented methods.
connect()
protected java.sql.Statement stmt
connect()
-method.
connect()
protected boolean transaction
true
if transaction has been started. Othervise false
protected int transactionIsolationLevel
protected int scrollType
protected int concurType
protected Log.NamedLog logQuery
protected Log.NamedLog logConn
protected Log.NamedLog logConnMid
public static boolean doLog
Constructor Detail |
public DB()
public DB(java.lang.String cname)
Method Detail |
protected void incConn()
protected void decConn()
public boolean isConnected()
public void setScrollType(int newType)
public void setConcurType(int newType)
public void log(Log.NamedLog logger, java.lang.String sentence)
public void elog(java.lang.String method, java.lang.String sentence)
public void elog(Log.NamedLog logger, java.lang.String method, java.lang.String sentence)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.lang.Exception
java.lang.Exception
protected java.sql.Connection loadDriver(int connectionType) throws java.lang.Exception
connectionType
- 1 = Connection with PoolMan
2 = Connection without PoolMan
3 = Connection with JDBC-ODBC Bridge
java.lang.Exception
public void connect() throws java.lang.Exception
java.lang.Exception
public void disconnect()
public java.sql.ResultSet executeQuery(java.lang.String sqlSentence) throws java.lang.Exception
sqlSentence
- SQL-query to execute
java.lang.Exception
public int executeUpdate(java.lang.String sqlSentence) throws java.lang.Exception
sqlSentence
- SQL-update to execute
java.lang.Exception
public void addBatch(java.lang.String sqlSentence) throws java.lang.Exception
java.lang.Exception
public int[] executeBatch() throws java.lang.Exception
java.lang.Exception
public void beginTransaction() throws java.lang.Exception
java.lang.Exception
public void endTransaction() throws java.lang.Exception
beginTransaction()
-method.
If there is no active transaction, method does nothing.
java.lang.Exception
beginTransaction()
public void abortTransaction() throws java.lang.Exception
java.lang.Exception
beginTransaction()
public java.sql.DatabaseMetaData getMetaData() throws java.lang.Exception
java.lang.Exception
public int getTransactionIsolationLevel() throws java.lang.Exception
java.lang.Exception
public void setTransactionIsolationLevel(int level) throws java.lang.Exception
java.lang.Exception
protected void finalize()
finalize
in class java.lang.Object
public static int connectionCount()
public static int getID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |