| java.lang.Object org.apache.james.util.SqlResources
SqlResources | public class SqlResources (Code) | | Provides a set of SQL String resources (eg SQL Strings)
to use for a database connection.
This class allows SQL strings to be customised to particular
database products, by detecting product information from the
jdbc DatabaseMetaData object.
|
Method Summary | |
public String | getDbOption(String name) Returns the dbOption string value set for the specified dbOption name.
Parameters: name - the name of the dbOption required. | public String | getSqlString(String name) Returns a named SQL string for the specified connection,
replacing parameters with the values set.
Parameters: name - the name of the SQL resource required. | public String | getSqlString(String name, boolean required) Returns a named SQL string for the specified connection,
replacing parameters with the values set. | public void | init(File sqlFile, String sqlDefsSection, Connection conn, Map configParameters) Configures a DbResources object to provide SQL statements from a file. |
getDbOption | public String getDbOption(String name)(Code) | | Returns the dbOption string value set for the specified dbOption name.
Parameters: name - the name of the dbOption required. the requested dbOption value |
getSqlString | public String getSqlString(String name)(Code) | | Returns a named SQL string for the specified connection,
replacing parameters with the values set.
Parameters: name - the name of the SQL resource required. the requested resource |
getSqlString | public String getSqlString(String name, boolean required)(Code) | | Returns a named SQL string for the specified connection,
replacing parameters with the values set.
Parameters: name - the name of the SQL resource required. Parameters: required - true if the resource is required the requested resource throws: ConfigurationException - if a required resource cannot be found. |
init | public void init(File sqlFile, String sqlDefsSection, Connection conn, Map configParameters) throws Exception(Code) | | Configures a DbResources object to provide SQL statements from a file.
SQL statements returned may be specific to the particular type
and version of the connected database, as well as the database driver.
Parameters encoded as $(parameter} in the input file are
replace by values from the parameters Map, if the named parameter exists.
Parameter values may also be specified in the resourceSection element.
Parameters: sqlFile - the input file containing the string definitions Parameters: sqlDefsSection - the xml element containing the strings to be used Parameters: conn - the Jdbc DatabaseMetaData, taken from a database connection Parameters: configParameters - a map of parameters (name-value string pairs) which arereplaced where found in the input strings |
|
|