org.eigenbase.util
Class JdbcDataSource

java.lang.Object
  extended by org.eigenbase.jdbc4.Unwrappable
      extended by org.eigenbase.util.JdbcDataSource
All Implemented Interfaces:
DataSource
Direct Known Subclasses:
FarragoSessionDataSource

public class JdbcDataSource
extends Unwrappable
implements DataSource

Adapter to make a JDBC connection into a DataSource.

Since:
Sep 7, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/util/JdbcDataSource.java#13 $
Author:
jhyde

Field Summary
private  int loginTimeout
           
private  PrintWriter logWriter
           
private  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()
           
 String getUrl()
           
 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

private 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)
"Precondition:"
url != null
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getUrl

public String getUrl()

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface DataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface DataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface DataSource
Throws:
SQLException