SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.jdbc
Class DataSourceImpl

java.lang.Object
  |
  +--com.solarmetric.rd.jdbc.DataSourceImpl
All Implemented Interfaces:
javax.sql.DataSource

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

Implementation of the DataSource interface that maintains a back-end connection pool.


Constructor Summary
DataSourceImpl()
          Construct a data source with the default pooling.
DataSourceImpl(com.solarmetric.rd.jdbc.ConnectionPool pool)
          Construct a data source with the given pooling.
 
Method Summary
 void close()
          Close all resources used by the data source.
 java.sql.Connection getConnection()
          Return a connection using the default user name and password.
 java.sql.Connection getConnection(java.lang.String user, java.lang.String pass)
          Return a connection using the given user name and password.
 java.lang.String getConnectionDriverName()
          The JDBC driver class name.
 com.solarmetric.rd.jdbc.ConnectionPool getConnectionPool()
          Return the connection pool for this datasource.
 java.util.Properties getConnectionProperties()
          Properties to pass to the DriverManager when creating connections.
 java.lang.String getConnectionURL()
          The URL to connect to.
 java.lang.String getConnectionUserName()
          The default user name to use when making connections.
 java.sql.Driver getDriver()
          Instantiate and return the driver.
 org.apache.commons.logging.Log getJDBCLog()
          The log to write JDBC messages to.
 int getLoginTimeout()
          The number of seconds to wait for database login when creating connections.
 java.io.PrintWriter getLogWriter()
          A writer to log to; the preferred logging method is throw the Log interface.
 org.apache.commons.logging.Log getSQLLog()
          The log to write SQL messages to.
 boolean isJDBCLogEnabled()
          Return true if JDBC logging is enabled.
 boolean isSQLLogEnabled()
          Return true if SQL logging is enabled.
 void logJDBC(java.lang.String msg, java.sql.Connection conn)
          Log a JDBC message on behalf of the given connection.
 void logSQL(java.lang.String msg, java.sql.Connection conn)
          Log a SQL message on behalf of the given connection.
 void setConnectionDriverName(java.lang.String val)
          The JDBC driver class name.
 void setConnectionPassword(java.lang.String val)
          The default password to use when making connections.
 void setConnectionProperties(java.util.Properties props)
          Properties to pass to the DriverManager when creating connections.
 void setConnectionURL(java.lang.String url)
          The URL to connect to.
 void setConnectionUserName(java.lang.String val)
          The default user name to use when making connections.
 void setJDBCLog(org.apache.commons.logging.Log log)
          The log to write JDBC messages to.
 void setLoginTimeout(int timeout)
          The number of seconds to wait for database login when creating connections.
 void setLogWriter(java.io.PrintWriter out)
          A writer to log to; the preferred logging method is throw the Log interface.
 void setSQLLog(org.apache.commons.logging.Log log)
          The log to write SQL messages to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceImpl

public DataSourceImpl()
Construct a data source with the default pooling.


DataSourceImpl

public DataSourceImpl(com.solarmetric.rd.jdbc.ConnectionPool pool)
Construct a data source with the given pooling.

Method Detail

getConnectionPool

public com.solarmetric.rd.jdbc.ConnectionPool getConnectionPool()
Return the connection pool for this datasource. Defaults to a PSCacheConnectionPool.


getConnectionUserName

public java.lang.String getConnectionUserName()
The default user name to use when making connections.


setConnectionUserName

public void setConnectionUserName(java.lang.String val)
The default user name to use when making connections.


setConnectionPassword

public void setConnectionPassword(java.lang.String val)
The default password to use when making connections.


getConnectionURL

public java.lang.String getConnectionURL()
The URL to connect to.


setConnectionURL

public void setConnectionURL(java.lang.String url)
The URL to connect to.


getConnectionProperties

public java.util.Properties getConnectionProperties()
Properties to pass to the DriverManager when creating connections.


setConnectionProperties

public void setConnectionProperties(java.util.Properties props)
Properties to pass to the DriverManager when creating connections.


getConnectionDriverName

public java.lang.String getConnectionDriverName()
The JDBC driver class name.


setConnectionDriverName

public void setConnectionDriverName(java.lang.String val)
The JDBC driver class name.


getLoginTimeout

public int getLoginTimeout()
The number of seconds to wait for database login when creating connections.

Specified by:
getLoginTimeout in interface javax.sql.DataSource

setLoginTimeout

public void setLoginTimeout(int timeout)
The number of seconds to wait for database login when creating connections.

Specified by:
setLoginTimeout in interface javax.sql.DataSource

getLogWriter

public java.io.PrintWriter getLogWriter()
A writer to log to; the preferred logging method is throw the Log interface.

Specified by:
getLogWriter in interface javax.sql.DataSource

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
A writer to log to; the preferred logging method is throw the Log interface.

Specified by:
setLogWriter in interface javax.sql.DataSource

getJDBCLog

public org.apache.commons.logging.Log getJDBCLog()
The log to write JDBC messages to.


setJDBCLog

public void setJDBCLog(org.apache.commons.logging.Log log)
The log to write JDBC messages to.


isJDBCLogEnabled

public boolean isJDBCLogEnabled()
Return true if JDBC logging is enabled.


getSQLLog

public org.apache.commons.logging.Log getSQLLog()
The log to write SQL messages to.


setSQLLog

public void setSQLLog(org.apache.commons.logging.Log log)
The log to write SQL messages to.


isSQLLogEnabled

public boolean isSQLLogEnabled()
Return true if SQL logging is enabled.


logJDBC

public void logJDBC(java.lang.String msg,
                    java.sql.Connection conn)
Log a JDBC message on behalf of the given connection.


logSQL

public void logSQL(java.lang.String msg,
                   java.sql.Connection conn)
Log a SQL message on behalf of the given connection.


getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Return a connection using the default user name and password.

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

getConnection

public java.sql.Connection getConnection(java.lang.String user,
                                         java.lang.String pass)
                                  throws java.sql.SQLException
Return a connection using the given user name and password.

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

close

public void close()
Close all resources used by the data source.


getDriver

public java.sql.Driver getDriver()
                          throws java.sql.SQLException
Instantiate and return the driver.

java.sql.SQLException

toString

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

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.