org.jadetower.sql.impl
Class AvalonSQLManager

java.lang.Object
  extended byorg.jadetower.sql.impl.AvalonSQLManager
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, SQLManager

public class AvalonSQLManager
extends java.lang.Object
implements SQLManager, org.apache.avalon.framework.configuration.Configurable

An Avalon based SQLManager.

Configuration Example:


  <sql-manager>
    <query id="customer">
        SELECT NAME, ADDRESS, PHONE
        FROM CUSTOMER_TABLE
        WHERE ORDER_NUMBER = ${orderNumber}
    </query>
  </sql-manager>

 


Field Summary
protected  boolean m_configured
           
protected  java.util.Map m_sqlMap
           
 
Fields inherited from interface org.jadetower.sql.SQLManager
ROLE
 
Constructor Summary
AvalonSQLManager()
           
AvalonSQLManager(java.lang.String url)
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          configures evaluator keys and sql queries
protected  void configure(java.lang.String uri)
          Alternate configuration method for non-Avalon environments.
 SQLEvaluator getSQL(java.lang.String key)
          returns an SQLEvaluator for the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_configured

protected boolean m_configured

m_sqlMap

protected java.util.Map m_sqlMap
Constructor Detail

AvalonSQLManager

public AvalonSQLManager()

AvalonSQLManager

public AvalonSQLManager(java.lang.String url)
                 throws java.lang.InstantiationException
Method Detail

getSQL

public SQLEvaluator getSQL(java.lang.String key)
returns an SQLEvaluator for the given key.

Specified by:
getSQL in interface SQLManager
Parameters:
key - valid query key
Returns:
an SQLEvaluator for the given key. If no key exists, returns null.

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
configures evaluator keys and sql queries

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - an Avalon Configuration. see above for schema.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - thrown if error created during configuration

configure

protected void configure(java.lang.String uri)
                  throws java.lang.Exception
Alternate configuration method for non-Avalon environments. The object can ONLY be configured ONCE. Uses the same schema as above.

Parameters:
uri - location of XML configuration file.
Throws:
java.lang.Exception - throw if error during configuration


Copyright © 2003 JadeTower. All Rights Reserved.