|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.util.sql.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. |
protected void |
init(org.w3c.dom.Document sqlDoc,
java.lang.String sqlDefsSection,
java.sql.Connection conn,
java.util.Map configParameters)
Configures a SqlResources object from an xml document. |
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. |
void |
init(java.io.InputStream input,
java.lang.String sqlDefsSection,
java.sql.Connection conn,
java.util.Map configParameters)
Configures a DbResources object to provide SQL statements from an InputStream. |
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 void init(java.io.InputStream input, java.lang.String sqlDefsSection, java.sql.Connection conn, java.util.Map configParameters) throws java.lang.Exception
input
- the input stream containing the xmlsqlDefsSection
- 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
protected void init(org.w3c.dom.Document sqlDoc, java.lang.String sqlDefsSection, java.sql.Connection conn, java.util.Map configParameters) throws java.sql.SQLException
sqlDoc
- sqlDefsSection
- conn
- configParameters
-
java.sql.SQLException
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
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 |