org.eigenbase.util
Class JdbcDataSource
java.lang.Object
org.eigenbase.jdbc4.Unwrappable
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
url
private 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)- "Precondition:"
- url != null
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