rabbit.filter
Class DataSourceHelper

java.lang.Object
  extended by rabbit.filter.DataSourceHelper

public class DataSourceHelper
extends Object

A helper class for dealing with DataSource:s

Author:
Robert Olofsson

Constructor Summary
DataSourceHelper(SProperties props, String defaultSelect)
          Create a new DataSourceHelper
 
Method Summary
 Connection getConnection()
          Get a database connection
 String getSelect()
          Get the select statement for this helper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceHelper

public DataSourceHelper(SProperties props,
                        String defaultSelect)
                 throws NamingException
Create a new DataSourceHelper

Parameters:
props - the properties to read configuration from
defaultSelect - the default sql statement to use if not configured
Throws:
NamingException - if the DataSource can not be found
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Get a database connection

Returns:
a database connection
Throws:
SQLException - if the database connection can not be established

getSelect

public String getSelect()
Get the select statement for this helper.

Returns:
the sql statement