com.elvyx.server.db
Class HsqldbDaoImpl

java.lang.Object
  extended by com.elvyx.server.db.HsqldbDaoImpl
All Implemented Interfaces:
Dao

public class HsqldbDaoImpl
extends java.lang.Object
implements Dao

Dao implementation for hsqldb. This class load the hsqldb, and implement the functionalities needed to interact with the database

Since:
1.0
Version:
$Revision: 1.6 $
Author:
Armando Perdomo

Constructor Summary
HsqldbDaoImpl(java.util.Properties properties)
          Constructor for HsqldbDAOImpl.
 
Method Summary
 void create()
          Create the database
 void eraseDatabase()
          Erase the database
 java.util.List getDifferences(java.lang.Integer clientId, java.lang.Integer statement_id)
          Return the differences between the two last time the sql statement was executed
 java.util.Date getLastTime(java.lang.Integer clientId, java.lang.Integer statement_id)
          Return last time some statement sql was executed
 java.lang.Object getMeanAndVariance(java.lang.Integer clientId, java.lang.String prepared, java.lang.String statement)
          Return mean and variance for this statement
 java.util.List getSQLDetails(java.lang.Integer clientId, java.lang.String prepared, java.lang.String statement)
          Return details about specific sql statement, it means all data for this sq statement
 java.lang.Integer getSQLPreparedId(java.lang.Integer clientId, java.lang.String prepared)
          Return the id for a sql prepared
 java.lang.Integer getSQLStatementId(java.lang.Integer clientId, java.lang.String statement)
          Return the id for a sql statement
 java.util.List getSQLStatements(java.lang.Object object)
          Return the sql statements following the filter rules.
 java.util.List getSQLStatementsWithoutBoundSql(java.lang.Object object)
          Return the sql statement without bound sql statements
 void insertSQLData(java.lang.Integer clientId, java.lang.String connectionId, java.lang.Integer prepared_id, java.lang.Integer statement_id, java.util.Date actual_time, java.util.Date last_time, java.lang.Integer elapsed, java.lang.Integer elapsedPStmt, java.lang.String category)
          Insert a sql data
 void insertSQLPrepared(java.lang.Integer clientId, java.lang.String prepared)
          Insert the sql prepared
 void insertSQLStatement(java.lang.Integer clientId, java.lang.String connectionId, java.lang.Integer preparedId, java.lang.String prepared)
          Insert a sql statement
 void stopDatabase()
          Stop the database.
 void updateSQLData(java.lang.Integer clientId, java.lang.String connectionId, java.lang.String prepared, java.lang.String statement, java.util.Date actual_time, java.util.Date last_time, java.lang.Integer elapsed, java.lang.Integer elapsedPStmt, java.lang.Integer rs_size, java.lang.Integer rs_elapsed, java.lang.String category)
          Update a sql data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HsqldbDaoImpl

public HsqldbDaoImpl(java.util.Properties properties)
              throws java.sql.SQLException,
                     java.io.IOException,
                     java.io.FileNotFoundException
Constructor for HsqldbDAOImpl.

Throws:
java.sql.SQLException
java.io.IOException
java.io.FileNotFoundException
Method Detail

create

public void create()
            throws java.sql.SQLException
Create the database

Specified by:
create in interface Dao
Throws:
java.sql.SQLException

insertSQLPrepared

public void insertSQLPrepared(java.lang.Integer clientId,
                              java.lang.String prepared)
                       throws java.sql.SQLException
Insert the sql prepared

Specified by:
insertSQLPrepared in interface Dao
Parameters:
clientId -
prepared -
Throws:
java.sql.SQLException

getSQLPreparedId

public java.lang.Integer getSQLPreparedId(java.lang.Integer clientId,
                                          java.lang.String prepared)
                                   throws java.sql.SQLException
Return the id for a sql prepared

Specified by:
getSQLPreparedId in interface Dao
Parameters:
clientId -
prepared -
Returns:
Throws:
java.sql.SQLException

insertSQLStatement

public void insertSQLStatement(java.lang.Integer clientId,
                               java.lang.String connectionId,
                               java.lang.Integer preparedId,
                               java.lang.String prepared)
                        throws java.sql.SQLException
Insert a sql statement

Specified by:
insertSQLStatement in interface Dao
Parameters:
clientId -
prepared_id -
statement -
Throws:
java.sql.SQLException

getSQLStatementId

public java.lang.Integer getSQLStatementId(java.lang.Integer clientId,
                                           java.lang.String statement)
                                    throws java.sql.SQLException
Return the id for a sql statement

Specified by:
getSQLStatementId in interface Dao
Parameters:
clientId -
statement -
Returns:
Throws:
java.sql.SQLException

insertSQLData

public void insertSQLData(java.lang.Integer clientId,
                          java.lang.String connectionId,
                          java.lang.Integer prepared_id,
                          java.lang.Integer statement_id,
                          java.util.Date actual_time,
                          java.util.Date last_time,
                          java.lang.Integer elapsed,
                          java.lang.Integer elapsedPStmt,
                          java.lang.String category)
                   throws java.sql.SQLException
Insert a sql data

Specified by:
insertSQLData in interface Dao
Parameters:
clientId -
prepared_id -
statement_id -
actual_time -
last_time -
elapsed -
category -
Throws:
java.sql.SQLException

updateSQLData

public void updateSQLData(java.lang.Integer clientId,
                          java.lang.String connectionId,
                          java.lang.String prepared,
                          java.lang.String statement,
                          java.util.Date actual_time,
                          java.util.Date last_time,
                          java.lang.Integer elapsed,
                          java.lang.Integer elapsedPStmt,
                          java.lang.Integer rs_size,
                          java.lang.Integer rs_elapsed,
                          java.lang.String category)
                   throws java.sql.SQLException
Update a sql data

Specified by:
updateSQLData in interface Dao
Parameters:
clientId -
prepared_id -
statement_id -
actual_time -
last_time -
elapsed -
category -
Throws:
java.sql.SQLException

getLastTime

public java.util.Date getLastTime(java.lang.Integer clientId,
                                  java.lang.Integer statement_id)
                           throws java.sql.SQLException
Return last time some statement sql was executed

Specified by:
getLastTime in interface Dao
Parameters:
clientId -
statement_id -
Returns:
Throws:
java.sql.SQLException

getSQLStatements

public java.util.List getSQLStatements(java.lang.Object object)
                                throws java.sql.SQLException
Return the sql statements following the filter rules. Filter rules: All, Update , Insert, etc

Specified by:
getSQLStatements in interface Dao
Parameters:
object -
Returns:
Throws:
java.sql.SQLException

getSQLStatementsWithoutBoundSql

public java.util.List getSQLStatementsWithoutBoundSql(java.lang.Object object)
                                               throws java.sql.SQLException
Return the sql statement without bound sql statements

Specified by:
getSQLStatementsWithoutBoundSql in interface Dao
Parameters:
object -
Returns:
Throws:
java.sql.SQLException

getSQLDetails

public java.util.List getSQLDetails(java.lang.Integer clientId,
                                    java.lang.String prepared,
                                    java.lang.String statement)
                             throws java.sql.SQLException
Return details about specific sql statement, it means all data for this sq statement

Specified by:
getSQLDetails in interface Dao
Parameters:
clientId -
prepared -
statement -
Returns:
Throws:
java.sql.SQLException

getMeanAndVariance

public java.lang.Object getMeanAndVariance(java.lang.Integer clientId,
                                           java.lang.String prepared,
                                           java.lang.String statement)
                                    throws java.sql.SQLException
Return mean and variance for this statement

Specified by:
getMeanAndVariance in interface Dao
Parameters:
clientId -
prepared -
statement -
Returns:
Throws:
java.sql.SQLException

getDifferences

public java.util.List getDifferences(java.lang.Integer clientId,
                                     java.lang.Integer statement_id)
                              throws java.sql.SQLException
Return the differences between the two last time the sql statement was executed

Specified by:
getDifferences in interface Dao
Parameters:
clientId -
statement_id -
Returns:
Throws:
java.sql.SQLException

stopDatabase

public void stopDatabase()
                  throws java.sql.SQLException
Stop the database. Cases like hsqldb must be executed a shutdown.

Specified by:
stopDatabase in interface Dao
Throws:
java.sql.SQLException

eraseDatabase

public void eraseDatabase()
                   throws java.sql.SQLException
Erase the database

Specified by:
eraseDatabase in interface Dao
Throws:
java.sql.SQLException


Copyright © 2006-2008 Armando Perdomo. All Rights Reserved.