org.osjava.sj.loader
Class SJDataSource

java.lang.Object
  extended by org.osjava.sj.loader.SJDataSource
All Implemented Interfaces:
DataSource

public class SJDataSource
extends Object
implements DataSource

A basic implementation of a DataSource.


Constructor Summary
SJDataSource(String driver, String url, String username, String password, Properties properties)
           
 
Method Summary
 boolean equals(Object obj)
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
          returns a connection to the database specified in the properties and creates a connection pool, if neccessary
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 int hashCode()
           
 boolean isWrapperFor(Class<?> iface)
           
 void setLoginTimeout(int timeout)
           
 void setLogWriter(PrintWriter pw)
           
 String toString()
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SJDataSource

public SJDataSource(String driver,
                    String url,
                    String username,
                    String password,
                    Properties properties)
Method Detail

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.