|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.james.util.SqlResources
public class SqlResources
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.
Constructor Summary | |
---|---|
SqlResources()
|
Method Summary | |
---|---|
java.lang.String |
getDbOption(java.lang.String name)
Returns the dbOption string value set for the specified dbOption name. |
java.lang.String |
getSqlString(java.lang.String name)
Returns a named SQL string for the specified connection, replacing parameters with the values set. |
java.lang.String |
getSqlString(java.lang.String name,
boolean required)
Returns a named SQL string for the specified connection, replacing parameters with the values set. |
void |
init(java.io.File sqlFile,
java.lang.String sqlDefsSection,
java.sql.Connection conn,
java.util.Map configParameters)
Configures a DbResources object to provide SQL statements from a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlResources()
Method Detail |
---|
public void init(java.io.File sqlFile, java.lang.String sqlDefsSection, java.sql.Connection conn, java.util.Map configParameters) throws java.lang.Exception
sqlFile
- the input file containing the string definitionssqlDefsSection
- the xml element containing the strings to be usedconn
- the Jdbc DatabaseMetaData, taken from a database connectionconfigParameters
- a map of parameters (name-value string pairs) which are
replaced where found in the input strings
java.lang.Exception
public java.lang.String getSqlString(java.lang.String name)
name
- the name of the SQL resource required.
public java.lang.String getSqlString(java.lang.String name, boolean required)
name
- the name of the SQL resource required.required
- true if the resource is required
ConfigurationException
- if a required resource cannot be found.public java.lang.String getDbOption(java.lang.String name)
name
- the name of the dbOption required.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |