net.walend.jdbc
Class GenericDataSource

java.lang.Object
  |
  +--net.walend.jdbc.GenericDataSource
All Implemented Interfaces:
javax.sql.DataSource

public class GenericDataSource
extends java.lang.Object
implements javax.sql.DataSource

A class that implements DataSource for non-DataSource databases so I can treat everthing as a DataSource.

Since:
20001127
Author:
David Walend

Field Summary
private  java.lang.String dbURL
           
private  java.lang.String passWord
           
private  java.lang.String userName
           
 
Constructor Summary
(package private) GenericDataSource(java.lang.String dbDriver, java.lang.String dbURL, java.lang.String userName, java.lang.String passWord)
           
 
Method Summary
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.lang.String userName, java.lang.String passWord)
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
private static void loadDriver(java.lang.String driverName)
           
 void setLoginTimeout(int ignore)
           
 void setLogWriter(java.io.PrintWriter printWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbURL

private java.lang.String dbURL

userName

private java.lang.String userName

passWord

private java.lang.String passWord
Constructor Detail

GenericDataSource

GenericDataSource(java.lang.String dbDriver,
                  java.lang.String dbURL,
                  java.lang.String userName,
                  java.lang.String passWord)
            throws java.sql.SQLException
Method Detail

loadDriver

private static void loadDriver(java.lang.String driverName)
                        throws java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource

getConnection

public java.sql.Connection getConnection(java.lang.String userName,
                                         java.lang.String passWord)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Specified by:
getLogWriter in interface javax.sql.DataSource

setLogWriter

public void setLogWriter(java.io.PrintWriter printWriter)
                  throws java.sql.SQLException
Specified by:
setLogWriter in interface javax.sql.DataSource

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Specified by:
getLoginTimeout in interface javax.sql.DataSource

setLoginTimeout

public void setLoginTimeout(int ignore)
                     throws java.sql.SQLException
Specified by:
setLoginTimeout in interface javax.sql.DataSource


Copyright (c) 2000, 2001, David Walend