com.townleyenterprises.persistence
Class SQLProvider

java.lang.Object
  extended bycom.townleyenterprises.persistence.SQLProvider

public final class SQLProvider
extends java.lang.Object

This class provides a way to make the database queries that are used by these classes more modular and separate from the code. This class will provide access to the statements in the form of a HashMap-style interface, so that the SQL statements are accessed by a name.

It should also be said that there are no public, non-static methods for this class. The only public method is get() and will return the specific statement or null, if it doesn't exist.

Two separate files are used by this class. The first file is named 'statements.sql' and contains all of the vendor-independent SQL statments. Like the standard resource bundle, various statements_VENDOR.sql files are also consulted to create a unified statement map for the particular vendor. This vendor is retrieved from the application's AppConfig class.

Prior to using this class, it should be configured using the initialize() method.

Version:
$Id: SQLProvider.java,v 1.3 2004/07/28 10:33:59 atownley Exp $
Author:
Andrew S. Townley

Method Summary
static java.lang.String get(java.lang.String name)
          This method returns the named statement based on the current environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static java.lang.String get(java.lang.String name)
This method returns the named statement based on the current environment.

Parameters:
name - the logical statement name
Returns:
the SQL statement for the specified environment


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.