org.enhydra.jdbc.standard
Class StandardDataSource

java.lang.Object
  |
  +--org.enhydra.jdbc.util.JdbcUtil
        |
        +--org.enhydra.jdbc.core.CoreDataSource
              |
              +--org.enhydra.jdbc.standard.StandardDataSource
All Implemented Interfaces:
javax.sql.DataSource, javax.naming.spi.ObjectFactory, javax.naming.Referenceable, java.io.Serializable
Direct Known Subclasses:
IdbDataSource, StandardConnectionPoolDataSource

public class StandardDataSource
extends CoreDataSource
implements javax.sql.DataSource

Provides a Data Source which can be used to generate JDBC connections.

This class is generic in the sense that it does not rely upon anything other than standard Java APIs. It uses java.sql.DriverManager and preconfigured properties to construct a JDBC connection. Important : networkProtocol, portNumber, serverName are not used. Please use instead the url property.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.enhydra.jdbc.core.CoreDataSource
logWriter, password, user
 
Fields inherited from class org.enhydra.jdbc.util.JdbcUtil
log
 
Constructor Summary
  StandardDataSource()
          Constructors
protected StandardDataSource(java.sql.Driver drv)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.sql.Connection getConnection()
          Methods inherited from DataSource
 java.sql.Connection getConnection(java.lang.String u, java.lang.String p)
           
 java.lang.String getDriverName()
          Setter/Getter defined for standard properties
 java.lang.Object getObjectInstance(java.lang.Object refObj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable env)
          Methods inherited from ObjectFactory
 javax.naming.Reference getReference()
          Methods inherited from referenceable
 int getTransactionIsolation()
           
 java.lang.String getUrl()
           
 int hashCode()
           
 void setDriverName(java.lang.String driverName)
           
 void setTransactionIsolation(int level)
           
 void setUrl(java.lang.String url)
           
 java.lang.String toString()
           
 
Methods inherited from class org.enhydra.jdbc.core.CoreDataSource
getDescription, getLoginTimeout, getLogWriter, getPassword, getThreadFactory, getUser, isDebug, isVerbose, setDebug, setDescription, setLoginTimeout, setLogWriter, setPassword, setThreadFactory, setUser, setVerbose, shutdown
 
Methods inherited from class org.enhydra.jdbc.util.JdbcUtil
setLogger
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.DataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

StandardDataSource

public StandardDataSource()
Constructors


StandardDataSource

protected StandardDataSource(java.sql.Driver drv)
                      throws java.sql.SQLException
Method Detail

getDriverName

public java.lang.String getDriverName()
Setter/Getter defined for standard properties


getUrl

public java.lang.String getUrl()

setDriverName

public void setDriverName(java.lang.String driverName)
                   throws java.sql.SQLException
java.sql.SQLException

setUrl

public void setUrl(java.lang.String url)

setTransactionIsolation

public void setTransactionIsolation(int level)

getTransactionIsolation

public int getTransactionIsolation()

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Methods inherited from DataSource

Specified by:
getConnection in interface javax.sql.DataSource
java.sql.SQLException

getConnection

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

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Methods inherited from referenceable

Specified by:
getReference in interface javax.naming.Referenceable
Overrides:
getReference in class CoreDataSource
javax.naming.NamingException

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object refObj,
                                          javax.naming.Name name,
                                          javax.naming.Context nameCtx,
                                          java.util.Hashtable env)
                                   throws java.lang.Exception
Methods inherited from ObjectFactory

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Overrides:
getObjectInstance in class CoreDataSource
java.lang.Exception

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object