Daedalos JUnit Extensions Quickstart
DatabaseChecker:
Constructor
- public DatabaseChecker(java.sql.Connection conn)
Initialize the new instance with connection, that will be used for all database access.
Methods
- public boolean rowExists(String tableName, String whereClause)
throws java.sql.SQLException
Returns whether or not the row that matches the given where clause exists in the specified table. The method returns
true, if there is exactly one row that matches. Zero or more than one row returns false.
- public boolean rowsExist(String tableName, String whereClause)
throws java.sql.SQLException
Returns whether or not one or more rows exist that match the given where clause in the specified table. The method
returns true, if there is any row that matches. Zero rows returns false.
- public long rowCount(String tableName)
throws java.sql.SQLException
Returns the current number of rows in the specified table
- public long rowCount(String tableName, String whereClause)
throws java.sql.SQLException
Returns the current number of rows in the specified table that match the conditions in the given where clause.
- public boolean tableExists(String tableName)
Returns whether or not the specified table exists in the database
- public String getStringColumn(String tableName, String columnName, String
whereClause)
throws java.sql.SQLException
Returns the value of the specified column in the first row that matches the given where clause in the specified
table . If the column is not of type VARCHAR an exception will be thrown.
- public int getIntColumn(String tableName, String columnName, String whereClause)
throws java.sql.SQLException
Returns the value of the specified column in the first row that matches the given where clause in the specified
table . If the column is not of type INTEGER an exception will be thrown.
(C)opyright 2001-2006 by Jens Uwe Pipka, Germany. Contact: jens-uwe.pipka@jup-net.de