1 19 20 package org.apache.cayenne.conf; 21 22 import java.io.PrintWriter ; 23 import java.sql.Connection ; 24 import java.sql.SQLException ; 25 26 import javax.sql.DataSource ; 27 28 import org.apache.cayenne.access.DataNode; 29 30 38 class NodeDataSource implements DataSource { 39 40 DataNode node; 41 42 NodeDataSource(DataNode node) { 43 this.node = node; 44 } 45 46 public Connection getConnection() throws SQLException { 47 return node.getDataSource().getConnection(); 48 } 49 50 public Connection getConnection(String username, String password) throws SQLException { 51 return node.getDataSource().getConnection(username, password); 52 } 53 54 public PrintWriter getLogWriter() throws SQLException { 55 return node.getDataSource().getLogWriter(); 56 } 57 58 public void setLogWriter(PrintWriter out) throws SQLException { 59 node.getDataSource().setLogWriter(out); 60 } 61 62 public void setLoginTimeout(int seconds) throws SQLException { 63 node.getDataSource().setLoginTimeout(seconds); 64 } 65 66 public int getLoginTimeout() throws SQLException { 67 return node.getDataSource().getLoginTimeout(); 68 } 69 } 70 | Popular Tags |