com.bea.p13n.property
Class SqlBundle
java.lang.Object
|
+--com.bea.p13n.property.SqlBundle
- public class SqlBundle
- extends java.lang.Object
Utility class to externalize SQL statements in a ResourceBundle.
Field Summary
|
static java.lang.String |
SQL_BUNDLE
the property to read to find the name of our sql bundle |
Constructor Summary
|
SqlBundle()
Default constructor |
SqlBundle(java.lang.String defaultBundleName)
Construct a SqlBundle with a default bundle name |
Method Summary
|
java.sql.PreparedStatement |
getStatement(java.sql.Connection conn,
java.lang.String key)
Use the provided connection to prepare the SQL statement named
by the provided key. |
void |
init()
Initialize the ResourceBundle that backs up this bundle. |
void |
init(java.lang.String defaultSqlBundle)
Initialize the ResourceBundle that backs up this bundle. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
SQL_BUNDLE
public static final java.lang.String SQL_BUNDLE
- the property to read to find the name of our sql bundle
SqlBundle
public SqlBundle()
- Default constructor
SqlBundle
public SqlBundle(java.lang.String defaultBundleName)
- Construct a SqlBundle with a default bundle name
init
public void init()
- Initialize the ResourceBundle that backs up this bundle. This will
look for the variable "SqlBundle" in the initial context to find
the name to use for the ResourceBundle; if that is not found it will
fall back to the name provided in the constructor.
init
public void init(java.lang.String defaultSqlBundle)
- Initialize the ResourceBundle that backs up this bundle. This will
look for the variable "SqlBundle" in the initial context to find
the name to use for the ResourceBundle; if that is not found it will
fall back to the provided name.
- Parameters:
defaultSqlBundle
- the default name to use for the ResourceBundle
getStatement
public java.sql.PreparedStatement getStatement(java.sql.Connection conn,
java.lang.String key)
throws java.sql.SQLException
- Use the provided connection to prepare the SQL statement named
by the provided key.
- Parameters:
conn
- a valid database connectionkey
- the key to lookup a SQL statement with- Returns:
- a PreparedStatement created with the sql
- Throws:
- java.sql.SQLException - if an error occurs creating the statement
Copyright © 2002 BEA Systems, Inc. All Rights Reserved