org.firebirdsql.pool
Class SimpleDataSource
java.lang.Object
|
+--org.firebirdsql.pool.SimpleDataSource
- All Implemented Interfaces:
- javax.sql.DataSource
- public class SimpleDataSource
- extends java.lang.Object
- implements javax.sql.DataSource
This is simple implementation of DataSource
interface that uses
ConnectionPoolDataSource
as connection provider.
- Author:
- Roman Rokytskyy
Constructor Summary |
SimpleDataSource(javax.sql.ConnectionPoolDataSource pool)
Create instance of this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleDataSource
public SimpleDataSource(javax.sql.ConnectionPoolDataSource pool)
- Create instance of this class.
- Parameters:
pool
- instance of ConnectionPoolDataSource
that will provide
connections to this data source.
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Get JDBC connection.
- Specified by:
getConnection
in interface javax.sql.DataSource
- Returns:
- instance of
Connection
from this data source. - Throws:
java.sql.SQLException
- if connection cannot be obtained.
getConnection
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
- Get JDBC connection for the specified username and password.
- Specified by:
getConnection
in interface javax.sql.DataSource
- Parameters:
username
- username for new connection.password
- password corresponding to the username.- Returns:
- instance of
Connection
. - Throws:
java.sql.SQLException
- if connection cannot be obtained.
getLogWriter
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
- Specified by:
getLogWriter
in interface javax.sql.DataSource
getLoginTimeout
public int getLoginTimeout()
throws java.sql.SQLException
- Specified by:
getLoginTimeout
in interface javax.sql.DataSource
setLogWriter
public void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
- Specified by:
setLogWriter
in interface javax.sql.DataSource
setLoginTimeout
public void setLoginTimeout(int seconds)
throws java.sql.SQLException
- Specified by:
setLoginTimeout
in interface javax.sql.DataSource
isWrapperFor
public boolean isWrapperFor(java.lang.Class arg0)
throws java.sql.SQLException
unwrap
public java.lang.Object unwrap(java.lang.Class arg0)
throws java.sql.SQLException
Copyright © 2001 David Jencks and other authors. All rights reserved.