1 21 22 package org.apache.derby.jdbc; 23 24 import java.sql.Connection ; 25 import java.sql.SQLException ; 26 import javax.sql.DataSource ; 27 28 import org.apache.derby.client.am.LogWriter; 29 import org.apache.derby.client.am.SqlException; 30 import org.apache.derby.client.net.NetConnection; 31 import org.apache.derby.client.net.NetLogWriter; 32 33 104 public class ClientDataSource extends ClientBaseDataSource implements DataSource { 105 private final static long serialVersionUID = 1894299584216955553L; 106 public static final String className__ = "org.apache.derby.jdbc.ClientDataSource"; 107 108 140 141 148 public ClientDataSource() { 149 super(); 150 } 151 152 153 155 162 public Connection getConnection() throws SQLException { 163 return getConnection(getUser(), getPassword()); 164 } 165 166 176 public Connection getConnection(String user, String password) throws SQLException { 177 182 try 183 { 184 LogWriter dncLogWriter = super.computeDncLogWriterForNewConnection("_sds"); 185 updateDataSourceValues(tokenizeAttributes(getConnectionAttributes(), null)); 186 return ClientDriver.getFactory().newNetConnection 187 ((NetLogWriter) dncLogWriter, user, 188 password, this, -1, false); 189 } 190 catch(SqlException se) 191 { 192 throw se.getSQLException(); 193 } 194 195 } 196 197 } 198 199 | Popular Tags |