|
1.51.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--interbase.interclient.ConnectionPoolModule
The ConnectionPoolModule class implements the javax.sql.DataSource interface so that an instance of ConnectionPoolModule can be registered with JNDI as a JDBC DataSource. Instances of the ConnectionPoolModule class will be used directly by applications to create database connections. ConnectionPoolModule supports one standard data source property, DataSourceName, which is used to locate a connection pool data source when one is needed. A ConnectionPoolDataSource is only used when there is a miss in the connection cache. In this case, a second JNDI lookup() operation is done to produce a ConnectionPoolDataSource object. The ConnectionPoolDataSource object is used to create a new PooledConnection object.
Constructor Summary | |
ConnectionPoolModule()
|
Method Summary | |
Connection |
getConnection()
Attempt to establish a database connection. |
Connection |
getConnection(String user,
String password)
|
String |
getDataSourceName()
|
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
PrintWriter |
getLogWriter()
Get the log writer for this data source. |
javax.naming.Reference |
getReference()
Creates a JNDI naming Reference of this data source. |
void |
setDataSourceName(String s)
|
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
void |
setLogWriter(PrintWriter out)
Set the log writer for this data source. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ConnectionPoolModule()
Method Detail |
public Connection getConnection() throws SQLException
public Connection getConnection(String user, String password) throws SQLException
public String getDataSourceName()
public void setDataSourceName(String s)
public PrintWriter getLogWriter() throws SQLException
The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled.
public void setLogWriter(PrintWriter out) throws SQLException
This method provides a way to register a character stream to which tracing and error logging information will be written by a JDBC implementation. This allows for DataSource specific tracing. If one wants all Data-Sources to use the same log stream, one must register the stream with each DataSource object individually. Log messages written to a DataSource specific log stream are not written to the log stream maintained by the DriverManager. When a DataSource object is created the log writer is initially null, in other words, logging is disabled.
The log writer is a character output stream to which all logging and tracing messages for this data source object instance will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the java.sql.Drivermanager class. When a DataSource object is created the log writer is initially null, in other words, logging is disabled.
out
- the new log writer; to disable, set to nullpublic void setLoginTimeout(int seconds) throws SQLException
seconds
- the data source login time limitpublic int getLoginTimeout() throws SQLException
public javax.naming.Reference getReference() throws javax.naming.NamingException
|
1.51.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |