org.enhydra.jdbc.standard
Class StandardDataSource

java.lang.Object
  |
  +--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:
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

Fields inherited from class org.enhydra.jdbc.core.CoreDataSource
logWriter, password, user
 
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()
           
 void setDriverName(java.lang.String driverName)
           
 void setTransactionIsolation(int level)
           
 void setUrl(java.lang.String url)
           
 
Methods inherited from class org.enhydra.jdbc.core.CoreDataSource
getDescription, getLoginTimeout, getLogWriter, getPassword, getThreadFactory, getUser, isDebug, isVerbose, log, setDebug, setDescription, setLoginTimeout, setLogWriter, setPassword, setThreadFactory, setUser, setVerbose, shutdown
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, 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

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

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

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Methods inherited from referenceable
Overrides:
getReference in class CoreDataSource

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
Overrides:
getObjectInstance in class CoreDataSource

equals

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