kotkabeans
Class PreparedDB

java.lang.Object
  |
  +--kotkabeans.DB
        |
        +--kotkabeans.PreparedDB

public class PreparedDB
extends DB

provides a connection to the Kotka database to the other beans.


Field Summary
protected  java.sql.PreparedStatement pstmt
           
protected  java.lang.String sqlSentence
          Sql-sentence.
protected  int updateType
          Update type.
 
Fields inherited from class kotkabeans.DB
concurType, connecttime, createStack, doLog, driverLoaded, laskuri, lastSQL, logConn, logConnMid, logQuery, myconn, scrollType, stmt, transaction, transactionIsolationLevel
 
Constructor Summary
PreparedDB()
           
PreparedDB(java.lang.String name)
           
 
Method Summary
 void connect()
          Requests connection to the Kotka-database.
 void connect(java.lang.String sqlSentence, int updateType)
          /* Requests connection to the Kotka-database.
 void disconnect()
          Releases used connection.
 java.sql.ResultSet executeQuery()
          Executes SQL-query and establishes connection if needed.
 int executeUpdate()
          Executes SQL-update and registeres it to the log file.
protected  void finalize()
           
 void reconnect()
           
 void setDouble(int i, double value)
           
 void setInt(int i, int value)
           
 void setString(int i, java.lang.String value)
           
 
Methods inherited from class kotkabeans.DB
abortTransaction, addBatch, beginTransaction, connectionCount, decConn, elog, elog, endTransaction, executeBatch, executeQuery, executeUpdate, getID, getMetaData, getTransactionIsolationLevel, incConn, isConnected, loadDriver, log, prepareStatement, setConcurType, setScrollType, setTransactionIsolationLevel
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlSentence

protected java.lang.String sqlSentence
Sql-sentence. Initialized during connect()-method.

See Also:
connect()

updateType

protected int updateType
Update type. Initialized during connect()-method.

See Also:
connect()

pstmt

protected java.sql.PreparedStatement pstmt
Constructor Detail

PreparedDB

public PreparedDB()

PreparedDB

public PreparedDB(java.lang.String name)
Method Detail

connect

public void connect()
             throws java.lang.Exception
Description copied from class: DB
Requests connection to the Kotka-database. Connections are handled by Poolman. Sets internal variables.

Overrides:
connect in class DB
Throws:
java.lang.Exception

connect

public void connect(java.lang.String sqlSentence,
                    int updateType)
             throws java.lang.Exception
/* Requests connection to the Kotka-database. Connections are handled by Poolman. Sets internal variables.

java.lang.Exception

reconnect

public void reconnect()
               throws java.lang.Exception
java.lang.Exception

setString

public void setString(int i,
                      java.lang.String value)
               throws java.lang.Exception
java.lang.Exception

setInt

public void setInt(int i,
                   int value)
            throws java.lang.Exception
java.lang.Exception

setDouble

public void setDouble(int i,
                      double value)
               throws java.lang.Exception
java.lang.Exception

disconnect

public void disconnect()
Releases used connection.

Overrides:
disconnect in class DB

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.lang.Exception
Executes SQL-query and establishes connection if needed.

Returns:
ResultSet containing matching lines
java.lang.Exception

executeUpdate

public int executeUpdate()
                  throws java.lang.Exception
Executes SQL-update and registeres it to the log file. New connection is requested if no one exists allready.

java.lang.Exception

finalize

protected void finalize()
Overrides:
finalize in class DB