Repository: cayenne Updated Branches: refs/heads/master 7ca6164bb -> 34a3dc049
formatting, no changes Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/34a3dc04 Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/34a3dc04 Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/34a3dc04 Branch: refs/heads/master Commit: 34a3dc04906ef50dac95f0e2ff9c2ace21b421c5 Parents: 7ca6164 Author: aadamchik <aadamc...@apache.org> Authored: Wed Apr 22 15:32:27 2015 +0300 Committer: aadamchik <aadamc...@apache.org> Committed: Thu Apr 30 13:21:16 2015 +0300 ---------------------------------------------------------------------- .../org/apache/cayenne/conn/PoolDataSource.java | 35 +++++++++++--------- 1 file changed, 20 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/34a3dc04/cayenne-server/src/main/java/org/apache/cayenne/conn/PoolDataSource.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/main/java/org/apache/cayenne/conn/PoolDataSource.java b/cayenne-server/src/main/java/org/apache/cayenne/conn/PoolDataSource.java index 6969b89..ad0b33e 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/conn/PoolDataSource.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/conn/PoolDataSource.java @@ -17,7 +17,6 @@ * under the License. ****************************************************************/ - package org.apache.cayenne.conn; import java.io.PrintWriter; @@ -30,18 +29,18 @@ import javax.sql.DataSource; import javax.sql.PooledConnection; /** - * <p>PoolDataSource allows to generate pooled connections.</p> + * PoolDataSource allows to generate pooled connections. * - * <p>It is implemented as a wrapper around a non-pooled data source object. - * Delegates all method calls except for "getPooledConnection" to the underlying - * datasource. - * </p> + * <p> + * It is implemented as a wrapper around a non-pooled data source object. + * Delegates all method calls except for "getPooledConnection" to the underlying + * DataSource. * */ public class PoolDataSource implements ConnectionPoolDataSource { + private DataSource nonPooledDatasource; - /** Creates new PoolDataSource */ public PoolDataSource(DataSource nonPooledDatasource) { this.nonPooledDatasource = nonPooledDatasource; } @@ -50,36 +49,42 @@ public class PoolDataSource implements ConnectionPoolDataSource { nonPooledDatasource = new DriverDataSource(jdbcDriver, connectionUrl); } + @Override public int getLoginTimeout() throws SQLException { return nonPooledDatasource.getLoginTimeout(); } + @Override public void setLoginTimeout(int seconds) throws SQLException { nonPooledDatasource.setLoginTimeout(seconds); } + @Override public PrintWriter getLogWriter() throws SQLException { return nonPooledDatasource.getLogWriter(); } + @Override public void setLogWriter(PrintWriter out) throws SQLException { nonPooledDatasource.setLogWriter(out); } + @Override public PooledConnection getPooledConnection() throws SQLException { return new PooledConnectionImpl(nonPooledDatasource, null, null); } + @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { return new PooledConnectionImpl(nonPooledDatasource, user, password); } - /** - * @since 3.1 - * - * JDBC 4.1 compatibility under Java 1.5 - */ - public Logger getParentLogger() throws SQLFeatureNotSupportedException { - throw new UnsupportedOperationException(); - } + /** + * @since 3.1 + * + * JDBC 4.1 compatibility under Java 1.7 + */ + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new UnsupportedOperationException(); + } }