net.sf.saffron.util
Class JdbcDataSource
java.lang.Object
|
+--net.sf.saffron.util.JdbcDataSource
- All Implemented Interfaces:
- DataSource
- public class JdbcDataSource
- extends Object
- implements DataSource
Adapter to make a JDBC connection into a DataSource
.
- Since:
- Sep 7, 2003
- Version:
- $Id: //open/saffron/src/net/sf/saffron/util/JdbcDataSource.java#4 $
- Author:
- jhyde
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_url
public final String _url
_logWriter
private PrintWriter _logWriter
_loginTimeout
private int _loginTimeout
JdbcDataSource
public JdbcDataSource(String url)
- Creates a JDBC data source.
- Parameters:
url
- URL of JDBC connection (must not be null)- Pre-condition:
- url != null
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection
in interface DataSource
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- Specified by:
getConnection
in interface DataSource
SQLException
setLogWriter
public void setLogWriter(PrintWriter out)
throws SQLException
- Specified by:
setLogWriter
in interface DataSource
SQLException
getLogWriter
public PrintWriter getLogWriter()
throws SQLException
- Specified by:
getLogWriter
in interface DataSource
SQLException
setLoginTimeout
public void setLoginTimeout(int seconds)
throws SQLException
- Specified by:
setLoginTimeout
in interface DataSource
SQLException
getLoginTimeout
public int getLoginTimeout()
throws SQLException
- Specified by:
getLoginTimeout
in interface DataSource
SQLException