|
SafeJDBC v2.00 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.safejdbc.javax.sql.SafeDataSourceJndiBean
public class SafeDataSourceJndiBean
Implementation of that
allows the wrapping of native "clear" DataSourceDataSource that references an
application database - Works as a Bean (Caucho Resin, ...).
This class is a Bean factory to be used with some J2EE environments which
enable to load a Bean with setFoo() and getFoo() methods where foo is a property.
This is an example of resin.conf extract
for Caucho resin 2.1.xx. It loads
a SafeDataSource that enable to use getConnection() to get a Cipher Connection.
It's equivalent to the Tomcat 5.0 example described in
.
SafeDataSourceFactory
SafeDataSourceFactory| Constructor Summary | |
|---|---|
SafeDataSourceJndiBean()
This class should *not* be instanced (this constructor is mandatory for EJB behavior). |
|
| Method Summary | ||
|---|---|---|
Connection |
getConnection()
Returns a Cipher Connection to the database. |
|
Connection |
getConnection(String username,
String password)
Returns a Cipher Connection to the database. |
|
int |
getLoginTimeout()
Returns the login timeout (in seconds) for connecting to the database. |
|
PrintWriter |
getLogWriter()
Returns the log writer being used by this data source. |
|
boolean |
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. |
|
void |
setBase_jndi_context(String base_jndi_context)
Setter for base_jndi_context |
|
void |
setDs_safejdbc_catalog_lookup_name(String safejdbc_catalog_lookup_name)
Setter for ds_safejdbc_catalog_lookup_name |
|
void |
setDs_wrapped_lookup_name(String wrapped_lookup_name)
Setter for ds_wrapped_lookup_name |
|
void |
setLoginTimeout(int loginTimeout)
Sets the login timeout (in seconds) for connecting to the database. |
|
void |
setLogWriter(PrintWriter logWriter)
Sets the log writer being used by this data source. |
|
|
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SafeDataSourceJndiBean()
| Method Detail |
|---|
public void setBase_jndi_context(String base_jndi_context)
base_jndi_context - The base_jndi_context to set.public void setDs_safejdbc_catalog_lookup_name(String safejdbc_catalog_lookup_name)
ds_safejdbc_catalog_lookup_name - The ds_safejdbc_catalog_lookup_name to set.public void setDs_wrapped_lookup_name(String wrapped_lookup_name)
ds_wrapped_lookup_name - The ds_wrapped_lookup_name to set.
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLException - if a database access error occurs
public Connection getConnection(String username,
String password)
throws SQLException
getConnection in interface DataSourceusername - Database user on whose behalf the Connection is being madepassword - The database user's password
SQLException - if a database access error occurs
public int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLException - if a database access error occurs
public PrintWriter getLogWriter()
throws SQLException
getLogWriter in interface CommonDataSourceSQLException - if a database access error occurs
public void setLoginTimeout(int loginTimeout)
throws SQLException
setLoginTimeout in interface CommonDataSourceloginTimeout - The new login timeout, or zero for no timeout
SQLException - if a database access error occurs
public void setLogWriter(PrintWriter logWriter)
throws SQLException
setLogWriter in interface CommonDataSourcelogWriter - The new log writer
SQLException - if a database access error occurs
public <T> T unwrap(Class<T> iface)
throws SQLException
unwrap recursively on the wrapped object
or a proxy for that result. If the receiver is not a
wrapper and does not implement the interface, then an SQLException is thrown.
unwrap in interface Wrapperiface - A Class defining an interface that the result must implement.
SQLException - If no object found that implements the interface
public boolean isWrapperFor(Class<?> iface)
throws SQLException
isWrapperFor on the wrapped
object. If this does not implement the interface and is not a wrapper, return false.
This method should be implemented as a low-cost operation compared to unwrap so that
callers can use this method to avoid expensive unwrap calls that may fail. If this method
returns true then calling unwrap with the same argument should succeed.
isWrapperFor in interface Wrapperiface - a Class defining an interface.
SQLException - if an error occurs while determining whether this is a wrapper
for an object with the given interface.
|
SafeJDBC v2.00 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||