com.rhi.architecture.db
Class DBUtil

java.lang.Object
  extended bycom.rhi.architecture.db.DBUtil

public class DBUtil
extends java.lang.Object

Helper method to create a DataSource.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
DBUtil()
           
 
Method Summary
static void close(java.sql.Connection conn)
          helper method for closing connection objects.
static void close(java.sql.ResultSet rs)
          helper method for closing result set objects.
static void close(java.sql.Statement stmt)
          helper method for closing statement objects.
static javax.sql.DataSource getDataSource()
          Get the default DataSource
static javax.sql.DataSource getDataSource(java.lang.String name)
          Get a specific DataSource
static Logger log()
          return the configured logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUtil

public DBUtil()
Method Detail

getDataSource

public static javax.sql.DataSource getDataSource()
                                          throws ConfigurationException
Get the default DataSource

Returns:
DataSource
Throws:
ConfigurationException
Since:
1.0

getDataSource

public static javax.sql.DataSource getDataSource(java.lang.String name)
                                          throws ConfigurationException
Get a specific DataSource

Parameters:
name -
Returns:
DataSource
Throws:
ConfigurationException
Since:
1.0

close

public static void close(java.sql.Connection conn)
helper method for closing connection objects. Ignores exceptions that occur during the close() method.

Parameters:
conn -

close

public static void close(java.sql.Statement stmt)
helper method for closing statement objects. Ignores exceptions that occur during the close() method.

Parameters:
stmt -

close

public static void close(java.sql.ResultSet rs)
helper method for closing result set objects. Ignores exceptions that occur during the close() method.

Parameters:
rs -

log

public static Logger log()
return the configured logger. If a configuration error was detected, a default logger will be returned.

Returns:
Logger


Copyright © 2002-2004 Robert Half International. All Rights Reserved.