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

Field Summary
private  int _loginTimeout
           
private  PrintWriter _logWriter
           
 String _url
           
 
Constructor Summary
JdbcDataSource(String url)
          Creates a JDBC data source.
 
Method Summary
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_url

public final String _url

_logWriter

private PrintWriter _logWriter

_loginTimeout

private int _loginTimeout
Constructor Detail

JdbcDataSource

public JdbcDataSource(String url)
Creates a JDBC data source.

Parameters:
url - URL of JDBC connection (must not be null)
Pre-condition:
url != null
Method Detail

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

SourceForge.net_Logo