|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.james.util.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 | |
String |
getSqlString(String name)
Returns a named SQL string for the specified connection, replacing parameters with the values set. |
String |
getSqlString(String name,
boolean required)
Returns a named SQL string for the specified connection, replacing parameters with the values set. |
void |
init(File sqlFile,
String sqlDefsSection,
Connection conn,
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(File sqlFile, String sqlDefsSection, Connection conn, Map configParameters) throws 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
Exception
public String getSqlString(String name)
name
- the name of the SQL resource required.
public String getSqlString(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.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |