org.outerj.xreporter.util
Class DbConfigSupport

java.lang.Object
  extended byorg.outerj.xreporter.util.DbConfigSupport

public class DbConfigSupport
extends java.lang.Object


Constructor Summary
DbConfigSupport()
           
 
Method Summary
static java.util.HashMap dbConfigToHashMap(org.apache.avalon.framework.configuration.Configuration configuration)
          Convert a Configuration object containing "connection-params" to a HashMap object.
static java.util.Properties mapToProperties(java.util.Map map)
          Converts a Map to a Properties object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbConfigSupport

public DbConfigSupport()
Method Detail

dbConfigToHashMap

public static java.util.HashMap dbConfigToHashMap(org.apache.avalon.framework.configuration.Configuration configuration)
                                           throws org.apache.avalon.framework.configuration.ConfigurationException
Convert a Configuration object containing "connection-params" to a HashMap object. It is checked that at least an "url" parameter is present. Instead of directly creating a properties object (which can be passed to JDBC's getConnection method), a HashMap is created, because a HashMap is not threadsafe (not synchronized), which is needed because the connection parameters can potentially be getted from many threads at the same time by the DataSourceParam expression function.

Throws:
org.apache.avalon.framework.configuration.ConfigurationException

mapToProperties

public static java.util.Properties mapToProperties(java.util.Map map)
Converts a Map to a Properties object.