org.osjava.sj.loader
Class SJDataSource
java.lang.Object
org.osjava.sj.loader.SJDataSource
- All Implemented Interfaces:
- DataSource
public class SJDataSource
- extends Object
- implements DataSource
A basic implementation of a DataSource.
SJDataSource
public SJDataSource(String driver,
String url,
String username,
String password,
Properties properties)
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection in interface DataSource
- Throws:
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- returns a connection to the database specified in the properties and
creates a connection pool, if neccessary
- Specified by:
getConnection in interface DataSource
- Throws:
SQLException
getLogWriter
public PrintWriter getLogWriter()
throws SQLException
- Specified by:
getLogWriter in interface DataSource
- Throws:
SQLException
getLoginTimeout
public int getLoginTimeout()
throws SQLException
- Specified by:
getLoginTimeout in interface DataSource
- Throws:
SQLException
setLogWriter
public void setLogWriter(PrintWriter pw)
throws SQLException
- Specified by:
setLogWriter in interface DataSource
- Throws:
SQLException
setLoginTimeout
public void setLoginTimeout(int timeout)
throws SQLException
- Specified by:
setLoginTimeout in interface DataSource
- Throws:
SQLException
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
throws SQLException
- Throws:
SQLException
unwrap
public <T> T unwrap(Class<T> iface)
throws SQLException
- Throws:
SQLException
Copyright © 2003-2008 OSJava. All Rights Reserved.