SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.jdbc
Class PSCacheDataSource

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

public class PSCacheDataSource
extends ConfigurableDataSource

Wrapper around an existing DataSource that uses prepared statement caching. This class is meant to be used around 3rd-party data sources. If you are using a DataSourceImpl, then plug the PSCacheConnectionPool into the data source instead, as it will yield a much higher cache hit rate.

Can be configured with the following properties, in addition to those in ConfigurableDataSource:

See Also:
PreparedStatementCache

Constructor Summary
PSCacheDataSource(javax.sql.DataSource ds)
          Constructor.
 
Method Summary
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.lang.String user, java.lang.String pass)
           
 int getMaxCachedStatements()
           
 void setMaxCachedStatements(int max)
           
 
Methods inherited from class com.solarmetric.rd.jdbc.ConfigurableDataSource
addJDBCListener, getIgnoreTransactionMethods, getQueryTimeout, getTransactionIsolation, removeJDBCListener, setIgnoreTransactionMethods, setQueryTimeout, setTransactionIsolation, setTransactionIsolationLevel
 
Methods inherited from class com.solarmetric.rd.jdbc.DelegatingDataSource
appendInfo, equals, getDelegate, getInnermostDelegate, getLoginTimeout, getLogWriter, hashCode, setLoginTimeout, setLogWriter, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PSCacheDataSource

public PSCacheDataSource(javax.sql.DataSource ds)
Constructor. Supply wrapped data source.

Method Detail

getMaxCachedStatements

public int getMaxCachedStatements()

setMaxCachedStatements

public void setMaxCachedStatements(int max)

getConnection

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

getConnection

public java.sql.Connection getConnection(java.lang.String user,
                                         java.lang.String pass)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class ConfigurableDataSource
java.sql.SQLException

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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