Class powersoft.jcm.db.DbUtil
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class powersoft.jcm.db.DbUtil

java.lang.Object
   |
   +----powersoft.jcm.db.DbUtil

public class DbUtil
extends Object

Constructor Index

 o DbUtil()

Method Index

 o autoOpenQuery(Query)
Opens a query and advances to the next row in the result set.
 o connectTransaction(Transaction, String)
Connects a transaction object and registers the name of transaction object.
 o createQuery(Query, String)
Creates a query object using a registered transaction object.
 o getLog()
Tests whether database debug messages are output to the debug log stream.
 o setLog(boolean)
Specifies whether database debug messages should be output to the debug log stream.

Notes: This method simply calls Debug#setGroupLog with 'database' as the parameter.

Constructors

 o DbUtil
  public DbUtil()

Methods

 o connectTransaction
  public static void connectTransaction(Transaction trans,
                                        String name)
Connects a transaction object and registers the name of transaction object.

Notes: This method calls the Transaction.connect method of the transaction object and throws a runtime exception if the connection fails. It also registers the object with the given name in an internal table, so that a subsequent call to #createQuery knows which transaction object the query should be connected to.

Parameters:
trans - The transaction object to be connected.
name - The name of the transaction object.
Throws: RuntimeExceptionBase
if the transaction cannot be connection
 o createQuery
  public static void createQuery(Query query,
                                 String transName)
Creates a query object using a registered transaction object.

Notes: This method looks up the transaction object that has been previously registered by #connectTransaction. It then uses the transaction object to create the query. If no transaction objects has been registered with the name or if the Query#create returns false, a runtime exception will be thrown.

Parameters:
query - The query object to be created.
transName - The name of the registered transaction object.
Throws: RuntimeExceptionBase
if no transaction objects has been registered with the name or if the Query#create returns false.
 o autoOpenQuery
  public static void autoOpenQuery(Query query)
Opens a query and advances to the next row in the result set.

Notes: This method calls Query#open and then Query#moveNext.

Parameters:
query - The query object to be opened.
 o getLog
  public static boolean getLog()
Tests whether database debug messages are output to the debug log stream.

Notes: This method simply calls Debug#getGroupLog with 'database' as the parameter.

Returns:
true if debug messages are output to the debug log stream; false othewise.
See Also:
setLog
 o setLog
  public static void setLog(boolean log)
Specifies whether database debug messages should be output to the debug log stream.

Notes: This method simply calls Debug#setGroupLog with 'database' as the parameter.

Parameters:
log - If true, debug messages are output to the debug log. If false, debug message are not output to the debug log.
See Also:
setGroupLog

All Packages  Class Hierarchy  This Package  Previous  Next  Index