You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2013/04/24 06:37:31 UTC
svn commit: r1471245 [10/14] - in /db/derby/code/trunk/java:
client/org/apache/derby/client/ client/org/apache/derby/client/am/
client/org/apache/derby/client/am/stmtcache/
client/org/apache/derby/client/net/ client/org/apache/derby/jdbc/
testing/org/a...
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java Wed Apr 24 04:37:28 2013
@@ -21,11 +21,17 @@
package org.apache.derby.client.am;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.AccessController;
+import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
import javax.transaction.xa.XAException;
import org.apache.derby.jdbc.ClientBaseDataSourceRoot;
@@ -42,7 +48,7 @@ public class LogWriter {
private boolean driverConfigurationHasBeenWrittenToJdbc2Stream_ = false;
// It is assumed that this constructor is never called when logWriter is null.
- public LogWriter(java.io.PrintWriter printWriter, int traceLevel) {
+ public LogWriter(PrintWriter printWriter, int traceLevel) {
printWriter_ = printWriter;
traceLevel_ = traceLevel;
}
@@ -145,42 +151,44 @@ public class LogWriter {
if (instance == null) // this prevents NPE from instance.getClass() used below
{
return null;
- } else if (instance instanceof Connection && loggingEnabled(
+ } else if (instance instanceof ClientConnection && loggingEnabled(
ClientDataSourceInterface.TRACE_CONNECTION_CALLS)) {
- return "Connection";
- } else if (instance instanceof ResultSet && loggingEnabled(
+ return "ClientConnection";
+ } else if (instance instanceof ClientResultSet && loggingEnabled(
ClientDataSourceInterface.TRACE_RESULT_SET_CALLS)) {
- return "ResultSet";
- } else if (instance instanceof CallableStatement && loggingEnabled(
+ return "ClientResultSet";
+ } else if (instance instanceof ClientCallableStatement &&
+ loggingEnabled(
+ ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
+ return "ClientCallableStatement";
+ } else if (instance instanceof ClientPreparedStatement &&
+ loggingEnabled(
+ ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
+ return "ClientPreparedStatement";
+ } else if (instance instanceof ClientStatement && loggingEnabled(
ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
- return "CallableStatement";
- } else if (instance instanceof PreparedStatement && loggingEnabled(
- ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
- return "PreparedStatement";
- } else if (instance instanceof Statement && loggingEnabled(
- ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {
- return "Statement";
+ return "ClientStatement";
}
// Not yet externalizing Blob tracing, except for trace_all
- else if (instance instanceof Blob && loggingEnabled(
+ else if (instance instanceof ClientBlob && loggingEnabled(
ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
// lobs !!
{
- return "Blob";
+ return "ClientBlob";
}
- // Not yet externalizing Clob tracing, except for trace_all
- else if (instance instanceof Clob && loggingEnabled(
+ // Not yet externalizing ClientClob tracing, except for trace_all
+ else if (instance instanceof ClientClob && loggingEnabled(
ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
// bobs !!
{
- return "Clob";
+ return "ClientClob";
}
// Not yet externalizing dbmd catalog call tracing, except for trace_all
- else if (instance instanceof DatabaseMetaData && loggingEnabled(
+ else if (instance instanceof ClientDatabaseMetaData && loggingEnabled(
ClientDataSourceInterface.TRACE_ALL)) // add a trace level for
// dbmd ??
{
- return "DatabaseMetaData";
+ return "ClientDatabaseMetaData";
}
// we don't use instanceof javax.transaction.XAResource to avoid dependency on j2ee.jar
else if (loggingEnabled(ClientDataSourceInterface.TRACE_XA_CALLS) &&
@@ -232,37 +240,45 @@ public class LogWriter {
}
}
- void traceExit(Object instance, String methodName, ResultSet resultSet) {
+ public void traceExit(
+ Object instance,
+ String methodName,
+ ClientResultSet resultSet) {
+
String returnValue = (resultSet == null) ? "ResultSet@null" : "ResultSet@" + Integer.toHexString(resultSet.hashCode());
traceExit(instance, methodName, returnValue);
}
- void traceExit(
+ public void traceExit(
Object instance,
String methodName,
- CallableStatement returnValue) {
+ ClientCallableStatement returnValue) {
traceExit(instance, methodName, "CallableStatement@" + Integer.toHexString(returnValue.hashCode()));
}
- void traceExit(
+ public void traceExit(
Object instance,
String methodName,
- PreparedStatement returnValue) {
+ ClientPreparedStatement returnValue) {
traceExit(instance, methodName, "PreparedStatement@" + Integer.toHexString(returnValue.hashCode()));
}
- void traceExit(Object instance, String methodName, Statement returnValue) {
+ public void traceExit(
+ Object instance,
+ String methodName,
+ ClientStatement returnValue) {
+
traceExit(instance, methodName, "Statement@" + Integer.toHexString(returnValue.hashCode()));
}
- void traceExit(Object instance, String methodName, Blob blob) {
+ void traceExit(Object instance, String methodName, ClientBlob blob) {
String returnValue = (blob == null) ? "Blob@null" : "Blob@" + Integer.toHexString(blob.hashCode());
traceExit(instance, methodName, returnValue);
}
- void traceExit(Object instance, String methodName, Clob clob) {
+ void traceExit(Object instance, String methodName, ClientClob clob) {
String returnValue = (clob == null) ? "Clob@null" : "Clob@" + Integer.toHexString(clob.hashCode());
traceExit(instance, methodName, returnValue);
}
@@ -270,12 +286,16 @@ public class LogWriter {
void traceExit(
Object instance,
String methodName,
- DatabaseMetaData returnValue) {
+ ClientDatabaseMetaData returnValue) {
traceExit(instance, methodName, "DatabaseMetaData@" + Integer.toHexString(returnValue.hashCode()));
}
- void traceExit(Object instance, String methodName, Connection returnValue) {
+ void traceExit(
+ Object instance,
+ String methodName,
+ ClientConnection returnValue) {
+
traceExit(instance, methodName, "Connection@" + Integer.toHexString(returnValue.hashCode()));
}
@@ -646,7 +666,7 @@ public class LogWriter {
dncprintln("END TRACE_DIAGNOSTICS");
}
}
- public void traceDiagnosable(java.sql.SQLException e) {
+ public void traceDiagnosable(SQLException e) {
if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
return;
}
@@ -670,7 +690,7 @@ public class LogWriter {
// ------------------------ meta data tracing --------------------------------
void traceParameterMetaData(
- Statement statement,
+ ClientStatement statement,
ColumnMetaData columnMetaData) {
if (!loggingEnabled(
@@ -694,7 +714,7 @@ public class LogWriter {
}
void traceResultSetMetaData(
- Statement statement,
+ ClientStatement statement,
ColumnMetaData columnMetaData) {
if (!loggingEnabled(
@@ -791,7 +811,7 @@ public class LogWriter {
void traceConnectEntry(String server,
int port,
String database,
- java.util.Properties properties) {
+ Properties properties) {
if (loggingEnabled(
ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {
traceDriverConfigurationJdbc1();
@@ -811,13 +831,13 @@ public class LogWriter {
}
}
- void traceConnectExit(Connection connection) {
+ void traceConnectExit(ClientConnection connection) {
if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
traceConnectsExit(connection);
}
}
- public void traceConnectResetExit(Connection connection) {
+ public void traceConnectResetExit(ClientConnection connection) {
if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
traceConnectsResetExit(connection);
}
@@ -852,7 +872,7 @@ public class LogWriter {
private void traceConnectsResetEntry(String server,
int port,
String database,
- java.util.Properties properties) {
+ Properties properties) {
dncprintln("BEGIN TRACE_CONNECT_RESET");
dncprintln("Connection reset requested for " + server + ":" + port + "/" + database);
dncprint("Using properties: ");
@@ -863,7 +883,7 @@ public class LogWriter {
private void traceConnectsEntry(String server,
int port,
String database,
- java.util.Properties properties) {
+ Properties properties) {
synchronized (printWriter_) {
dncprintln("BEGIN TRACE_CONNECTS");
dncprintln("Attempting connection to " + server + ":" + port + "/" + database);
@@ -874,7 +894,7 @@ public class LogWriter {
}
// Specialized by NetLogWriter.traceConnectsExit()
- public void traceConnectsExit(Connection c) {
+ public void traceConnectsExit(ClientConnection c) {
synchronized (printWriter_) {
String header = "[Connection@" + Integer.toHexString(c.hashCode()) + "]";
try {
@@ -886,14 +906,14 @@ public class LogWriter {
dncprintln(header, "Driver name: " + c.databaseMetaData_.getDriverName());
dncprintln(header, "Driver version: " + c.databaseMetaData_.getDriverVersion());
dncprintln(header, "END TRACE_CONNECTS");
- } catch (java.sql.SQLException e) {
+ } catch (SQLException e) {
dncprintln(header, "Encountered an SQL exception while trying to trace connection exit");
dncprintln(header, "END TRACE_CONNECTS");
}
}
}
- public void traceConnectsResetExit(Connection c) {
+ public void traceConnectsResetExit(ClientConnection c) {
synchronized (printWriter_) {
String header = "[Connection@" + Integer.toHexString(c.hashCode()) + "]";
try {
@@ -905,7 +925,7 @@ public class LogWriter {
dncprintln(header, "Driver name: " + c.databaseMetaData_.getDriverName());
dncprintln(header, "Driver version: " + c.databaseMetaData_.getDriverVersion());
dncprintln(header, "END TRACE_CONNECT_RESET");
- } catch (java.sql.SQLException e) {
+ } catch (SQLException e) {
dncprintln(header, "Encountered an SQL exception while trying to trace connection reset exit");
dncprintln(header, "END TRACE_CONNECT_RESET");
}
@@ -916,10 +936,10 @@ public class LogWriter {
// properties.toString() will print out passwords,
// so this method was written to escape the password property value.
// printWriter_ synchronized by caller.
- private void writeProperties(java.util.Properties properties) {
+ private void writeProperties(Properties properties) {
printWriter_.print("{ ");
- for (java.util.Iterator i = properties.entrySet().iterator(); i.hasNext();) {
- java.util.Map.Entry e = (java.util.Map.Entry) (i.next());
+ for (Iterator i = properties.entrySet().iterator(); i.hasNext();) {
+ Map.Entry e = (Map.Entry) (i.next());
if ("password".equals(e.getKey())) {
printWriter_.print("password=" + escapePassword((String) e.getValue()));
} else {
@@ -964,8 +984,11 @@ public class LogWriter {
Version.writeDriverConfiguration(printWriter_);
}
- public static java.io.PrintWriter getPrintWriter(final String fileName, final boolean fileAppend) throws SqlException {
- java.io.PrintWriter printWriter = null;
+ public static PrintWriter getPrintWriter(
+ final String fileName,
+ final boolean fileAppend) throws SqlException {
+
+ PrintWriter printWriter = null;
//Using an anonymous class to deal with the PrintWriter because the
//method java.security.AccessController.doPrivileged requires an
//instance of a class(which implements
@@ -980,14 +1003,15 @@ public class LogWriter {
printWriter = AccessController.doPrivileged(
new PrivilegedExceptionAction<PrintWriter>(){
public PrintWriter run() throws IOException {
- String fileCanonicalPath = new java.io.File(fileName).getCanonicalPath();
- return new java.io.PrintWriter(
- new java.io.BufferedOutputStream(
- new java.io.FileOutputStream(
+ String fileCanonicalPath =
+ new File(fileName).getCanonicalPath();
+ return new PrintWriter(
+ new BufferedOutputStream(
+ new FileOutputStream(
fileCanonicalPath, fileAppend), 4096), true);
}
});
- } catch (java.security.PrivilegedActionException pae) {
+ } catch (PrivilegedActionException pae) {
throw new SqlException(null,
new ClientMessageId(SQLState.UNABLE_TO_OPEN_FILE),
new Object[] { fileName, pae.getMessage() },
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement.java Wed Apr 24 04:37:28 2013
@@ -25,6 +25,9 @@ import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.SQLException;
@@ -49,7 +52,7 @@ import org.apache.derby.client.am.stmtca
*/
public class LogicalCallableStatement
extends LogicalPreparedStatement
- implements java.sql.CallableStatement {
+ implements CallableStatement {
/**
* Creates a new logical callable statement.
@@ -59,7 +62,7 @@ public class LogicalCallableStatement
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalCallableStatement(java.sql.CallableStatement physicalCs,
+ public LogicalCallableStatement(CallableStatement physicalCs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor) {
super(physicalCs, stmtKey, cacheInteractor);
@@ -214,11 +217,11 @@ public class LogicalCallableStatement
return getPhysCs().getArray(i);
}
- public java.sql.Blob getBlob(int i) throws SQLException {
+ public Blob getBlob(int i) throws SQLException {
return getPhysCs().getBlob(i);
}
- public java.sql.Clob getClob(int i) throws SQLException {
+ public Clob getClob(int i) throws SQLException {
return getPhysCs().getClob(i);
}
@@ -306,11 +309,11 @@ public class LogicalCallableStatement
return getPhysCs().getArray(parameterName);
}
- public java.sql.Blob getBlob(String parameterName) throws SQLException {
+ public Blob getBlob(String parameterName) throws SQLException {
return getPhysCs().getBlob(parameterName);
}
- public java.sql.Clob getClob(String parameterName) throws SQLException {
+ public Clob getClob(String parameterName) throws SQLException {
return getPhysCs().getClob(parameterName);
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement40.java Wed Apr 24 04:37:28 2013
@@ -22,6 +22,9 @@ package org.apache.derby.client.am;
import java.io.InputStream;
import java.io.Reader;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
import java.sql.NClob;
import java.sql.RowId;
import java.sql.SQLException;
@@ -45,7 +48,7 @@ public class LogicalCallableStatement40
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalCallableStatement40(java.sql.CallableStatement physicalCs,
+ public LogicalCallableStatement40(CallableStatement physicalCs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor){
super(physicalCs, stmtKey, cacheInteractor);
@@ -262,12 +265,12 @@ public class LogicalCallableStatement40
return getPhysCs().getCharacterStream(arg0);
}
- public void setBlob(String arg0, java.sql.Blob arg1)
+ public void setBlob(String arg0, Blob arg1)
throws SQLException {
getPhysCs().setBlob(arg0, arg1);
}
- public void setClob(String arg0, java.sql.Clob arg1)
+ public void setClob(String arg0, Clob arg1)
throws SQLException {
getPhysCs().setClob(arg0, arg1);
}
@@ -331,13 +334,15 @@ public class LogicalCallableStatement40
public <T> T getObject( int parameterIndex, Class<T> type )
throws SQLException
{
- return ((CallableStatement40)getPhysCs()).getObject( parameterIndex, type );
+ return ((ClientCallableStatement40)getPhysCs()).
+ getObject(parameterIndex, type);
}
public <T> T getObject(String parameterName, Class<T> type)
throws SQLException
{
- return ((CallableStatement40)getPhysCs()).getObject( parameterName, type );
+ return ((ClientCallableStatement40)getPhysCs()).
+ getObject( parameterName, type );
}
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement42.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement42.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement42.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalCallableStatement42.java Wed Apr 24 04:37:28 2013
@@ -20,6 +20,7 @@
*/
package org.apache.derby.client.am;
+import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.SQLType;
import org.apache.derby.client.am.stmtcache.StatementKey;
@@ -40,7 +41,7 @@ public class LogicalCallableStatement42
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalCallableStatement42(java.sql.CallableStatement physicalCs,
+ public LogicalCallableStatement42(CallableStatement physicalCs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor){
super(physicalCs, stmtKey, cacheInteractor);
@@ -55,62 +56,72 @@ public class LogicalCallableStatement42
public void registerOutParameter( int parameterIndex, SQLType sqlType )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterIndex, sqlType );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterIndex, sqlType );
}
public void registerOutParameter( int parameterIndex, SQLType sqlType, int scale )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterIndex, sqlType, scale );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterIndex, sqlType, scale );
}
public void registerOutParameter( int parameterIndex, SQLType sqlType, String typeName )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterIndex, sqlType, typeName );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterIndex, sqlType, typeName );
}
public void registerOutParameter( String parameterName, SQLType sqlType )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterName, sqlType );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterName, sqlType );
}
public void registerOutParameter( String parameterName, SQLType sqlType, int scale )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterName, sqlType, scale );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterName, sqlType, scale );
}
public void registerOutParameter( String parameterName, SQLType sqlType, String typeName )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).registerOutParameter( parameterName, sqlType, typeName );
+ ((ClientCallableStatement42)getPhysCs()).
+ registerOutParameter( parameterName, sqlType, typeName );
}
public void setObject
- ( int parameterIndex, java.lang.Object x, SQLType sqlType )
+ ( int parameterIndex, Object x, SQLType sqlType )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).setObject( parameterIndex, x, sqlType );
+ ((ClientCallableStatement42)getPhysCs()).
+ setObject( parameterIndex, x, sqlType );
}
public void setObject
- ( int parameterIndex, java.lang.Object x, SQLType sqlType, int scaleOrLength )
+ ( int parameterIndex, Object x, SQLType sqlType, int scaleOrLength )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).setObject( parameterIndex, x, sqlType, scaleOrLength );
+ ((ClientCallableStatement42)getPhysCs()).
+ setObject( parameterIndex, x, sqlType, scaleOrLength );
}
public void setObject( String parameterName, Object x, SQLType sqlType )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).setObject( parameterName, x, sqlType );
+ ((ClientCallableStatement42)getPhysCs()).
+ setObject( parameterName, x, sqlType );
}
public void setObject( String parameterName, Object x, SQLType sqlType, int scaleOrLength )
throws SQLException
{
- ((CallableStatement42)getPhysCs()).setObject( parameterName, x, sqlType, scaleOrLength );
+ ((ClientCallableStatement42)getPhysCs()).
+ setObject( parameterName, x, sqlType, scaleOrLength );
}
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection.java Wed Apr 24 04:37:28 2013
@@ -21,7 +21,14 @@
package org.apache.derby.client.am;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Savepoint;
+import java.sql.Statement;
import java.util.Map;
import org.apache.derby.client.ClientPooledConnection;
import org.apache.derby.shared.common.reference.SQLState;
@@ -39,13 +46,13 @@ import org.apache.derby.shared.common.re
* nulled out, only the {@code PooledConnection} instance will maintain a
* handle to the physical connection.
*/
-public class LogicalConnection implements java.sql.Connection {
+public class LogicalConnection implements Connection {
/**
* Underlying physical connection for this logical connection.
* <p>
* Set to {@code null} when this logical connection is closed.
*/
- Connection physicalConnection_;
+ ClientConnection physicalConnection_;
private ClientPooledConnection pooledConnection_ = null;
/**
* Logical database metadata object created on demand and then cached.
@@ -56,7 +63,7 @@ public class LogicalConnection implement
private LogicalDatabaseMetaData logicalDatabaseMetaData = null;
public LogicalConnection(
- Connection physicalConnection,
+ ClientConnection physicalConnection,
ClientPooledConnection pooledConnection) throws SqlException {
physicalConnection_ = physicalConnection;
@@ -68,7 +75,7 @@ public class LogicalConnection implement
}
}
- protected void finalize() throws java.lang.Throwable {
+ protected void finalize() throws Throwable {
close();
}
@@ -178,7 +185,7 @@ public class LogicalConnection implement
// ---------------------- wrapped public entry points ------------------------
// All methods are forwarded to the physical connection in a standard way
- synchronized public java.sql.Statement createStatement() throws SQLException {
+ synchronized public Statement createStatement() throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.createStatement();
@@ -188,7 +195,8 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException {
+ synchronized public PreparedStatement prepareStatement(String sql)
+ throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareStatement(sql);
@@ -198,7 +206,11 @@ public class LogicalConnection implement
}
}
- synchronized public PreparedStatement preparePositionedUpdateStatement(String sql, Section querySection) throws SqlException {
+ synchronized
+ public ClientPreparedStatement preparePositionedUpdateStatement(
+ String sql,
+ Section querySection) throws SqlException {
+
try {
checkForNullPhysicalConnection();
} catch ( SQLException se ) {
@@ -207,7 +219,8 @@ public class LogicalConnection implement
return physicalConnection_.preparePositionedUpdateStatement(sql, querySection);
}
- synchronized public java.sql.CallableStatement prepareCall(String sql) throws SQLException {
+ synchronized public CallableStatement prepareCall(String sql)
+ throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareCall(sql);
@@ -287,7 +300,7 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.SQLWarning getWarnings() throws SQLException {
+ synchronized public SQLWarning getWarnings() throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.getWarnings();
@@ -322,7 +335,7 @@ public class LogicalConnection implement
* @return A database metadata object.
* @throws SQLException if an error occurs
*/
- public synchronized java.sql.DatabaseMetaData getMetaData()
+ public synchronized DatabaseMetaData getMetaData()
throws SQLException {
try {
checkForNullPhysicalConnection();
@@ -357,7 +370,7 @@ public class LogicalConnection implement
* @return The metadata object from the underlying physical connection.
* @throws SQLException if the logical connection has been closed
*/
- final synchronized java.sql.DatabaseMetaData getRealMetaDataObject()
+ final synchronized DatabaseMetaData getRealMetaDataObject()
throws SQLException {
// Check if the logical connection has been closed.
// isClosed also checks if physicalConnection_ is null.
@@ -413,7 +426,7 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.Statement createStatement(int resultSetType,
+ synchronized public Statement createStatement(int resultSetType,
int resultSetConcurrency) throws SQLException {
try {
checkForNullPhysicalConnection();
@@ -424,7 +437,7 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql,
+ synchronized public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) throws SQLException {
try {
@@ -436,7 +449,7 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.CallableStatement prepareCall(String sql,
+ synchronized public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) throws SQLException {
try {
@@ -468,8 +481,11 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldability) throws SQLException {
+ synchronized public Statement createStatement(
+ int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
@@ -479,9 +495,12 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldability) throws SQLException {
+ synchronized public CallableStatement prepareCall(
+ String sql,
+ int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
@@ -491,9 +510,12 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException {
+ synchronized public PreparedStatement prepareStatement(
+ String sql,
+ int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareStatement(sql, resultSetType, resultSetConcurrency,
@@ -504,8 +526,10 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
- throws SQLException {
+ synchronized public PreparedStatement prepareStatement(
+ String sql,
+ int autoGeneratedKeys) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareStatement(sql, autoGeneratedKeys);
@@ -515,8 +539,10 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql, int columnIndexes[])
- throws SQLException {
+ synchronized public PreparedStatement prepareStatement(
+ String sql,
+ int columnIndexes[]) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareStatement(sql, columnIndexes);
@@ -526,8 +552,10 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.PreparedStatement prepareStatement(String sql, String columnNames[])
- throws SQLException {
+ synchronized public PreparedStatement prepareStatement(
+ String sql,
+ String columnNames[]) throws SQLException {
+
try {
checkForNullPhysicalConnection();
return physicalConnection_.prepareStatement(sql, columnNames);
@@ -557,7 +585,7 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.Savepoint setSavepoint() throws SQLException {
+ synchronized public Savepoint setSavepoint() throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.setSavepoint();
@@ -567,7 +595,8 @@ public class LogicalConnection implement
}
}
- synchronized public java.sql.Savepoint setSavepoint(String name) throws SQLException {
+ synchronized public Savepoint setSavepoint(String name)
+ throws SQLException {
try {
checkForNullPhysicalConnection();
return physicalConnection_.setSavepoint(name);
@@ -577,7 +606,7 @@ public class LogicalConnection implement
}
}
- synchronized public void rollback(java.sql.Savepoint savepoint) throws SQLException {
+ synchronized public void rollback(Savepoint savepoint) throws SQLException {
try {
checkForNullPhysicalConnection();
physicalConnection_.rollback(savepoint);
@@ -587,7 +616,8 @@ public class LogicalConnection implement
}
}
- synchronized public void releaseSavepoint(java.sql.Savepoint savepoint) throws SQLException {
+ synchronized public void releaseSavepoint(Savepoint savepoint)
+ throws SQLException {
try {
checkForNullPhysicalConnection();
physicalConnection_.releaseSavepoint(savepoint);
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalConnection40.java Wed Apr 24 04:37:28 2013
@@ -22,6 +22,8 @@
package org.apache.derby.client.am;
import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
import java.sql.NClob;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
@@ -43,7 +45,7 @@ import org.apache.derby.shared.common.re
public class LogicalConnection40
extends LogicalConnection {
- public LogicalConnection40(Connection physicalConnection,
+ public LogicalConnection40(ClientConnection physicalConnection,
ClientPooledConnection pooledConnection)
throws SqlException {
super(physicalConnection, pooledConnection);
@@ -61,7 +63,7 @@ public class LogicalConnection40
}
}
- public java.sql.Blob createBlob()
+ public Blob createBlob()
throws SQLException {
try
{
@@ -73,7 +75,7 @@ public class LogicalConnection40
}
}
- public java.sql.Clob createClob()
+ public Clob createClob()
throws SQLException {
try
{
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData.java Wed Apr 24 04:37:28 2013
@@ -20,6 +20,9 @@
*/
package org.apache.derby.client.am;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -31,8 +34,7 @@ import java.sql.SQLException;
* lifetime of the metadata object equal to the logical connection instead
* of the underlying physical connection.
*/
-public class LogicalDatabaseMetaData
- implements java.sql.DatabaseMetaData {
+public class LogicalDatabaseMetaData implements DatabaseMetaData {
/** The associated logical connection. */
private final LogicalConnection logicalCon;
@@ -72,7 +74,7 @@ public class LogicalDatabaseMetaData
* @throws SQLException if the logical connection has been closed, or
* obtaining the metadata object fails
*/
- final java.sql.DatabaseMetaData getRealMetaDataObject()
+ final DatabaseMetaData getRealMetaDataObject()
throws SQLException {
return this.logicalCon.getRealMetaDataObject();
}
@@ -557,14 +559,14 @@ public class LogicalDatabaseMetaData
return getRealMetaDataObject().dataDefinitionIgnoredInTransactions();
}
- public java.sql.ResultSet getProcedures(
+ public ResultSet getProcedures(
String catalog, String schemaPattern, String procedureNamePattern)
throws SQLException {
return getRealMetaDataObject().getProcedures(
catalog, schemaPattern, procedureNamePattern);
}
- public java.sql.ResultSet getProcedureColumns(
+ public ResultSet getProcedureColumns(
String catalog,
String schemaPattern,
String procedureNamePattern,
@@ -574,40 +576,40 @@ public class LogicalDatabaseMetaData
schemaPattern, procedureNamePattern, columnNamePattern);
}
- public java.sql.ResultSet getTables(String catalog, String schemaPattern,
+ public ResultSet getTables(String catalog, String schemaPattern,
String tableNamePattern, String[] types)
throws SQLException {
return getRealMetaDataObject().getTables(
catalog, schemaPattern, tableNamePattern, types);
}
- public java.sql.ResultSet getSchemas() throws SQLException {
+ public ResultSet getSchemas() throws SQLException {
return getRealMetaDataObject().getSchemas();
}
- public java.sql.ResultSet getCatalogs() throws SQLException {
+ public ResultSet getCatalogs() throws SQLException {
return getRealMetaDataObject().getCatalogs();
}
- public java.sql.ResultSet getTableTypes() throws SQLException {
+ public ResultSet getTableTypes() throws SQLException {
return getRealMetaDataObject().getTableTypes();
}
- public java.sql.ResultSet getColumns(String catalog, String schemaPattern,
+ public ResultSet getColumns(String catalog, String schemaPattern,
String tableNamePattern, String columnNamePattern)
throws SQLException {
return getRealMetaDataObject().getColumns(
catalog, schemaPattern, tableNamePattern, columnNamePattern);
}
- public java.sql.ResultSet getColumnPrivileges(String catalog, String schema,
+ public ResultSet getColumnPrivileges(String catalog, String schema,
String table, String columnNamePattern)
throws SQLException {
return getRealMetaDataObject().getColumnPrivileges(
catalog, schema, table, columnNamePattern);
}
- public java.sql.ResultSet getTablePrivileges(
+ public ResultSet getTablePrivileges(
String catalog,
String schemaPattern,
String tableNamePattern) throws SQLException {
@@ -616,7 +618,7 @@ public class LogicalDatabaseMetaData
catalog, schemaPattern, tableNamePattern);
}
- public java.sql.ResultSet getBestRowIdentifier(
+ public ResultSet getBestRowIdentifier(
String catalog,
String schema,
String table,
@@ -627,14 +629,14 @@ public class LogicalDatabaseMetaData
catalog, schema, table, scope, nullable);
}
- public java.sql.ResultSet getVersionColumns(
+ public ResultSet getVersionColumns(
String catalog, String schema, String table)
throws SQLException {
return getRealMetaDataObject().getVersionColumns(
catalog, schema, table);
}
- public java.sql.ResultSet getPrimaryKeys(
+ public ResultSet getPrimaryKeys(
String catalog,
String schema,
String table) throws SQLException {
@@ -642,19 +644,19 @@ public class LogicalDatabaseMetaData
return getRealMetaDataObject().getPrimaryKeys(catalog, schema, table);
}
- public java.sql.ResultSet getImportedKeys(
+ public ResultSet getImportedKeys(
String catalog, String schema, String table)
throws SQLException {
return getRealMetaDataObject().getImportedKeys(catalog, schema, table);
}
- public java.sql.ResultSet getExportedKeys(
+ public ResultSet getExportedKeys(
String catalog, String schema, String table)
throws SQLException {
return getRealMetaDataObject().getExportedKeys(catalog, schema, table);
}
- public java.sql.ResultSet getCrossReference(String parentCatalog,
+ public ResultSet getCrossReference(String parentCatalog,
String parentSchema, String parentTable, String foreignCatalog,
String foreignSchema, String foreignTable)
throws SQLException {
@@ -663,11 +665,11 @@ public class LogicalDatabaseMetaData
foreignSchema, foreignTable);
}
- public java.sql.ResultSet getTypeInfo() throws SQLException {
+ public ResultSet getTypeInfo() throws SQLException {
return getRealMetaDataObject().getTypeInfo();
}
- public java.sql.ResultSet getIndexInfo(
+ public ResultSet getIndexInfo(
String catalog,
String schema,
String table,
@@ -728,14 +730,14 @@ public class LogicalDatabaseMetaData
return getRealMetaDataObject().supportsBatchUpdates();
}
- public java.sql.ResultSet getUDTs(String catalog, String schemaPattern,
+ public ResultSet getUDTs(String catalog, String schemaPattern,
String typeNamePattern, int[] types)
throws SQLException {
return getRealMetaDataObject().getUDTs(
catalog, schemaPattern, typeNamePattern, types);
}
- public java.sql.Connection getConnection() throws SQLException {
+ public Connection getConnection() throws SQLException {
getRealMetaDataObject(); // Just check if the connection is still open.
return this.logicalCon;
}
@@ -756,21 +758,21 @@ public class LogicalDatabaseMetaData
return getRealMetaDataObject().supportsGetGeneratedKeys();
}
- public java.sql.ResultSet getSuperTypes(
+ public ResultSet getSuperTypes(
String catalog, String schemaPattern, String typeNamePattern)
throws SQLException {
return getRealMetaDataObject().getSuperTypes(
catalog, schemaPattern, typeNamePattern);
}
- public java.sql.ResultSet getSuperTables(
+ public ResultSet getSuperTables(
String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
return getRealMetaDataObject().getSuperTables(
catalog, schemaPattern, tableNamePattern);
}
- public java.sql.ResultSet getAttributes(
+ public ResultSet getAttributes(
String catalog,
String schemaPattern,
String typeNamePattern,
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java Wed Apr 24 04:37:28 2013
@@ -20,6 +20,7 @@
*/
package org.apache.derby.client.am;
+import java.sql.ResultSet;
import java.sql.RowIdLifetime;
import java.sql.SQLException;
import org.apache.derby.shared.common.reference.SQLState;
@@ -51,19 +52,19 @@ public class LogicalDatabaseMetaData40
return getRealMetaDataObject().autoCommitFailureClosesAllResultSets();
}
- public java.sql.ResultSet getClientInfoProperties()
+ public ResultSet getClientInfoProperties()
throws SQLException {
return getRealMetaDataObject().getClientInfoProperties();
}
- public java.sql.ResultSet getFunctions(String catalog, String schemaPattern,
+ public ResultSet getFunctions(String catalog, String schemaPattern,
String functionNamePattern)
throws SQLException {
return getRealMetaDataObject().getFunctions(
catalog, schemaPattern, functionNamePattern);
}
- public java.sql.ResultSet getFunctionColumns(
+ public ResultSet getFunctionColumns(
String catalog, String schemaPattern,
String functionNamePattern,
String columnNamePattern) throws SQLException {
@@ -77,7 +78,7 @@ public class LogicalDatabaseMetaData40
return getRealMetaDataObject().getRowIdLifetime();
}
- public java.sql.ResultSet getSchemas(String catalog, String schemaPattern)
+ public ResultSet getSchemas(String catalog, String schemaPattern)
throws SQLException {
return getRealMetaDataObject().getSchemas(catalog, schemaPattern);
}
@@ -116,7 +117,7 @@ public class LogicalDatabaseMetaData40
/** See DatabaseMetaData javadoc */
public boolean generatedKeyAlwaysReturned() throws SQLException
{
- return ((DatabaseMetaData) getRealMetaDataObject()).
+ return ((ClientDatabaseMetaData)getRealMetaDataObject()).
generatedKeyAlwaysReturned();
}
@@ -124,12 +125,15 @@ public class LogicalDatabaseMetaData40
* See DatabaseMetaData javadoc. Empty ResultSet because Derby does
* not support pseudo columns.
*/
- public java.sql.ResultSet getPseudoColumns
+ public ResultSet getPseudoColumns
( String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern )
throws SQLException
{
- return ((DatabaseMetaData) getRealMetaDataObject()).getPseudoColumns
- ( catalog, schemaPattern, tableNamePattern, columnNamePattern );
+ return ((ClientDatabaseMetaData)getRealMetaDataObject()).
+ getPseudoColumns(catalog,
+ schemaPattern,
+ tableNamePattern,
+ columnNamePattern);
}
/////////////////////////////////////////////////////////////////////////
@@ -141,12 +145,12 @@ public class LogicalDatabaseMetaData40
/** See DatabaseMetaData javadoc */
public long getMaxLogicalLobSize() throws SQLException
{
- return ((DatabaseMetaData) getRealMetaDataObject()).
+ return ((ClientDatabaseMetaData)getRealMetaDataObject()).
getMaxLogicalLobSize();
}
public boolean supportsRefCursors() throws SQLException
{
- return ((DatabaseMetaData) getRealMetaDataObject()).
+ return ((ClientDatabaseMetaData)getRealMetaDataObject()).
supportsRefCursors();
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement.java Wed Apr 24 04:37:28 2013
@@ -27,8 +27,15 @@ import java.net.URL;
import java.util.Calendar;
import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Connection;
import java.sql.Date;
+import java.sql.ParameterMetaData;
+import java.sql.PreparedStatement;
import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Time;
@@ -50,7 +57,7 @@ import org.apache.derby.client.am.stmtca
*/
public class LogicalPreparedStatement
extends LogicalStatementEntity
- implements java.sql.PreparedStatement {
+ implements PreparedStatement {
/**
* Creates a new logical prepared statement.
@@ -60,7 +67,7 @@ public class LogicalPreparedStatement
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalPreparedStatement(java.sql.PreparedStatement physicalPs,
+ public LogicalPreparedStatement(PreparedStatement physicalPs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor) {
super(physicalPs, stmtKey, cacheInteractor);
@@ -176,11 +183,11 @@ public class LogicalPreparedStatement
getPhysPs().setArray(i, x);
}
- public void setBlob(int i, java.sql.Blob x) throws SQLException {
+ public void setBlob(int i, Blob x) throws SQLException {
getPhysPs().setBlob(i, x);
}
- public void setClob(int i, java.sql.Clob x) throws SQLException {
+ public void setClob(int i, Clob x) throws SQLException {
getPhysPs().setClob(i, x);
}
@@ -188,7 +195,7 @@ public class LogicalPreparedStatement
getPhysPs().setDate(parameterIndex, x);
}
- public java.sql.ParameterMetaData getParameterMetaData()
+ public ParameterMetaData getParameterMetaData()
throws SQLException {
return getPhysPs().getParameterMetaData();
}
@@ -197,11 +204,11 @@ public class LogicalPreparedStatement
getPhysPs().setRef(i, x);
}
- public java.sql.ResultSet executeQuery() throws SQLException {
+ public ResultSet executeQuery() throws SQLException {
return getPhysPs().executeQuery();
}
- public java.sql.ResultSetMetaData getMetaData() throws SQLException {
+ public ResultSetMetaData getMetaData() throws SQLException {
return getPhysPs().getMetaData();
}
@@ -350,15 +357,15 @@ public class LogicalPreparedStatement
return getPhysPs().execute(sql, columnIndexes);
}
- public java.sql.Connection getConnection() throws SQLException {
+ public Connection getConnection() throws SQLException {
return getPhysPs().getConnection();
}
- public java.sql.ResultSet getGeneratedKeys() throws SQLException {
+ public ResultSet getGeneratedKeys() throws SQLException {
return getPhysPs().getGeneratedKeys();
}
- public java.sql.ResultSet getResultSet() throws SQLException {
+ public ResultSet getResultSet() throws SQLException {
return getPhysPs().getResultSet();
}
@@ -376,7 +383,7 @@ public class LogicalPreparedStatement
return getPhysPs().execute(sql, columnNames);
}
- public java.sql.ResultSet executeQuery(String sql) throws SQLException {
+ public ResultSet executeQuery(String sql) throws SQLException {
return getPhysPs().executeQuery(sql);
}
@@ -388,7 +395,7 @@ public class LogicalPreparedStatement
public long executeLargeUpdate() throws SQLException
{
- return ((PreparedStatement) getPhysPs()).executeLargeUpdate();
+ return ((ClientPreparedStatement) getPhysPs()).executeLargeUpdate();
}
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement40.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,7 @@ package org.apache.derby.client.am;
import java.io.InputStream;
import java.io.Reader;
import java.sql.NClob;
+import java.sql.PreparedStatement;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLXML;
@@ -45,7 +46,7 @@ public class LogicalPreparedStatement40
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalPreparedStatement40(java.sql.PreparedStatement physicalPs,
+ public LogicalPreparedStatement40(PreparedStatement physicalPs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor){
super(physicalPs, stmtKey, cacheInteractor);
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement42.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement42.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement42.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalPreparedStatement42.java Wed Apr 24 04:37:28 2013
@@ -20,6 +20,7 @@
*/
package org.apache.derby.client.am;
+import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.SQLType;
@@ -39,14 +40,16 @@ public class LogicalPreparedStatement42
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- public LogicalPreparedStatement42
- ( java.sql.PreparedStatement physicalPs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor )
- {
+ public LogicalPreparedStatement42 (
+ PreparedStatement physicalPs,
+ StatementKey stmtKey,
+ StatementCacheInteractor cacheInteractor ) {
+
super(physicalPs, stmtKey, cacheInteractor);
}
public void setObject
- ( int parameterIndex, java.lang.Object x, SQLType targetSqlType )
+ ( int parameterIndex, Object x, SQLType targetSqlType )
throws SQLException
{
getPhysPs().setObject( parameterIndex, x, targetSqlType );
@@ -54,7 +57,7 @@ public class LogicalPreparedStatement42
public void setObject
(
- int parameterIndex, java.lang.Object x,
+ int parameterIndex, Object x,
SQLType targetSqlType, int scaleOrLength
) throws SQLException
{
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java Wed Apr 24 04:37:28 2013
@@ -20,7 +20,10 @@
*/
package org.apache.derby.client.am;
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
import java.sql.SQLException;
+import java.sql.Statement;
import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
import org.apache.derby.client.am.stmtcache.StatementKey;
import org.apache.derby.shared.common.reference.SQLState;
@@ -46,7 +49,7 @@ import org.apache.derby.shared.common.sa
*/
//@ThreadSafe
abstract class LogicalStatementEntity
- implements java.sql.Statement {
+ implements Statement {
/**
* Tells if we're holding a callable statement or not.
@@ -60,16 +63,16 @@ abstract class LogicalStatementEntity
* If this is {@code null}, the logical entity is closed.
*/
//@GuardedBy("this")
- private java.sql.PreparedStatement physicalPs;
+ private PreparedStatement physicalPs;
/**
- * Assoicated physical callable statement, if any.
+ * Associated physical callable statement, if any.
* <p>
* This is a convenience reference, to avoid having to cast on every
- * invokation of {@link #getPhysCs} if the logical entity represents a
+ * invocation of {@link #getPhysCs} if the logical entity represents a
* callable statement.
*/
//@GuardedBy("this)
- private java.sql.CallableStatement physicalCs;
+ private CallableStatement physicalCs;
/** The owner of this logical entity. */
private StatementCacheInteractor owner;
/** The key for the associated statement. */
@@ -86,7 +89,7 @@ abstract class LogicalStatementEntity
* @param cacheInteractor creating statement cache interactor
* @throws IllegalArgumentException if {@code cache} is {@code null}
*/
- protected LogicalStatementEntity(java.sql.PreparedStatement physicalPs,
+ protected LogicalStatementEntity(PreparedStatement physicalPs,
StatementKey stmtKey,
StatementCacheInteractor cacheInteractor) {
if (cacheInteractor.getCache() == null) {
@@ -99,14 +102,14 @@ abstract class LogicalStatementEntity
this.cache = cacheInteractor.getCache();
this.owner = cacheInteractor;
this.physicalPs = physicalPs;
- if (physicalPs instanceof java.sql.CallableStatement) {
+ if (physicalPs instanceof CallableStatement) {
this.hasCallableStmt = true;
- this.physicalCs = (java.sql.CallableStatement)physicalPs;
+ this.physicalCs = (CallableStatement)physicalPs;
} else {
this.hasCallableStmt = false;
this.physicalCs = null;
}
- ((PreparedStatement)physicalPs).setOwner(this);
+ ((ClientPreparedStatement)physicalPs).setOwner(this);
}
/**
@@ -115,7 +118,7 @@ abstract class LogicalStatementEntity
* @return A prepared statement.
* @throws SQLException if the logical statement has been closed
*/
- synchronized java.sql.PreparedStatement getPhysPs()
+ synchronized PreparedStatement getPhysPs()
throws SQLException {
if (physicalPs == null) {
throw (new SqlException(null,
@@ -131,7 +134,7 @@ abstract class LogicalStatementEntity
* @return A callable statement.
* @throws SQLException if the logical statement has been closed
*/
- synchronized java.sql.CallableStatement getPhysCs()
+ synchronized CallableStatement getPhysCs()
throws SQLException {
if (SanityManager.DEBUG) {
SanityManager.ASSERT(hasCallableStmt,
@@ -151,7 +154,7 @@ abstract class LogicalStatementEntity
* @return A statement.
* @throws SQLException if the logical statement has been closed
*/
- synchronized java.sql.Statement getPhysStmt()
+ synchronized Statement getPhysStmt()
throws SQLException
{
if ( hasCallableStmt ) { return getPhysCs(); }
@@ -165,8 +168,8 @@ abstract class LogicalStatementEntity
*/
public synchronized void close() throws SQLException {
if (physicalPs != null) {
- final PreparedStatement temporaryPsRef =
- (PreparedStatement)physicalPs;
+ final ClientPreparedStatement temporaryPsRef =
+ (ClientPreparedStatement)physicalPs;
// Nullify both references.
physicalPs = null;
physicalCs = null;
@@ -245,7 +248,7 @@ abstract class LogicalStatementEntity
* interface
*/
public <T> T unwrap(Class<T> iface) throws SQLException {
- if (((Statement) getPhysStmt()).isClosed()) {
+ if (((ClientStatement) getPhysStmt()).isClosed()) {
throw new SqlException(null,
new ClientMessageId(SQLState.ALREADY_CLOSED),
hasCallableStmt ? "CallableStatement" : "PreparedStatement")
@@ -269,12 +272,12 @@ abstract class LogicalStatementEntity
public void closeOnCompletion() throws SQLException
{
- ((Statement) getPhysStmt()).closeOnCompletion();
+ ((ClientStatement) getPhysStmt()).closeOnCompletion();
}
public boolean isCloseOnCompletion() throws SQLException
{
- return ((Statement) getPhysStmt()).isCloseOnCompletion();
+ return ((ClientStatement) getPhysStmt()).isCloseOnCompletion();
}
////////////////////////////////////////////////////////////////////
@@ -285,38 +288,38 @@ abstract class LogicalStatementEntity
public long[] executeLargeBatch() throws SQLException
{
- return ((Statement) getPhysStmt()).executeLargeBatch();
+ return ((ClientStatement) getPhysStmt()).executeLargeBatch();
}
public long executeLargeUpdate( String sql ) throws SQLException
{
- return ((Statement) getPhysStmt()).executeLargeUpdate( sql );
+ return ((ClientStatement) getPhysStmt()).executeLargeUpdate( sql );
}
public long executeLargeUpdate( String sql, int autoGeneratedKeys) throws SQLException
{
- return ((Statement) getPhysStmt()).
- executeLargeUpdate( sql, autoGeneratedKeys );
+ return ((ClientStatement)getPhysStmt()).
+ executeLargeUpdate(sql, autoGeneratedKeys);
}
public long executeLargeUpdate( String sql, int[] columnIndexes ) throws SQLException
{
- return ((Statement) getPhysStmt()).
- executeLargeUpdate( sql, columnIndexes );
+ return ((ClientStatement)getPhysStmt()).
+ executeLargeUpdate(sql, columnIndexes);
}
public long executeLargeUpdate( String sql, String[] columnNames ) throws SQLException
{
- return ((Statement) getPhysStmt()).
- executeLargeUpdate( sql, columnNames );
+ return ((ClientStatement)getPhysStmt()).
+ executeLargeUpdate(sql, columnNames);
}
public long getLargeUpdateCount() throws SQLException
{
- return ((Statement) getPhysStmt()).getLargeUpdateCount();
+ return ((ClientStatement) getPhysStmt()).getLargeUpdateCount();
}
public long getLargeMaxRows() throws SQLException
{
- return ((Statement) getPhysStmt()).getLargeMaxRows();
+ return ((ClientStatement) getPhysStmt()).getLargeMaxRows();
}
public void setLargeMaxRows(long maxRows) throws SQLException
{
- ((Statement) getPhysStmt()).setLargeMaxRows( maxRows );
+ ((ClientStatement) getPhysStmt()).setLargeMaxRows( maxRows );
}
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/MaterialStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/MaterialStatement.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/MaterialStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/MaterialStatement.java Wed Apr 24 04:37:28 2013
@@ -21,6 +21,8 @@
package org.apache.derby.client.am;
+import java.util.ArrayList;
+
public interface MaterialStatement {
@@ -61,7 +63,8 @@ public interface MaterialStatement {
public abstract void markClosedOnServer_();
- public abstract void writeSetSpecialRegister_(Section section, java.util.ArrayList sqlsttList) throws SqlException;
+ public abstract void writeSetSpecialRegister_(
+ Section section, ArrayList sqlsttList) throws SqlException;
public abstract void readSetSpecialRegister_() throws SqlException;
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java Wed Apr 24 04:37:28 2013
@@ -19,6 +19,8 @@
package org.apache.derby.client.am;
+import java.sql.ResultSet;
+
public class Section {
private int sectionNumber;
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java Wed Apr 24 04:37:28 2013
@@ -22,6 +22,7 @@
package org.apache.derby.client.am;
import java.lang.ref.WeakReference;
+import java.sql.ResultSet;
import java.util.Hashtable;
import java.util.Stack;
import org.apache.derby.shared.common.reference.SQLState;
@@ -80,9 +81,9 @@ public class SectionManager {
// Cursor name to ResultSet mapping is needed for positioned updates to check whether
// a ResultSet is scrollable. If so, exception is thrown.
- private final Hashtable<String, WeakReference<ResultSet>>
+ private final Hashtable<String, WeakReference<ClientResultSet>>
positionedUpdateCursorNameToResultSet_ =
- new Hashtable<String, WeakReference<ResultSet>>();
+ new Hashtable<String, WeakReference<ClientResultSet>>();
String databaseName;
@@ -130,7 +131,12 @@ public class SectionManager {
}
}
- protected Section getSection(java.util.Stack freeSections, String packageName, String cursorNamePrefix, int resultSetHoldability) throws SqlException {
+ protected Section getSection(
+ Stack freeSections,
+ String packageName,
+ String cursorNamePrefix,
+ int resultSetHoldability) throws SqlException {
+
if (!freeSections.empty()) {
return (Section) freeSections.pop();
} else if (nextAvailableSectionNumber_ < (maxNumSections_ - 1)) {
@@ -158,7 +164,7 @@ public class SectionManager {
// Get a section for a jdbc 2 positioned update/delete for the corresponding query.
// A positioned update section must come from the same package as its query section.
Section getPositionedUpdateSection(Section querySection) throws SqlException {
- Connection connection = agent_.connection_;
+ ClientConnection connection = agent_.connection_;
return getDynamicSection(connection.holdability());
}
@@ -188,19 +194,24 @@ public class SectionManager {
positionedUpdateCursorNameToQuerySection_.put(cursorName, section);
}
- void mapCursorNameToResultSet(String cursorName, ResultSet resultSet) {
+ void mapCursorNameToResultSet(
+ String cursorName,
+ ClientResultSet resultSet) {
+
// DERBY-3316. Needs WeakReference so that ResultSet can be garbage collected
positionedUpdateCursorNameToResultSet_.put(
- cursorName, new WeakReference<ResultSet>(resultSet));
+ cursorName, new WeakReference<ClientResultSet>(resultSet));
}
- ResultSet getPositionedUpdateResultSet(String cursorName) throws SqlException {
- ResultSet rs = positionedUpdateCursorNameToResultSet_.get(cursorName).get();
+ ClientResultSet getPositionedUpdateResultSet(String cursorName)
+ throws SqlException {
+ ClientResultSet rs =
+ positionedUpdateCursorNameToResultSet_.get(cursorName).get();
if (rs == null) {
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.LANG_RESULT_SET_NOT_OPEN), "update");
}
- return (rs.resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) ? null : rs;
+ return (rs.resultSetType_ == ResultSet.TYPE_FORWARD_ONLY) ? null : rs;
}
void removeCursorNameToResultSetMapping(String clientCursorName,
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java Wed Apr 24 04:37:28 2013
@@ -21,6 +21,7 @@
package org.apache.derby.client.am;
+import java.io.PrintWriter;
import java.sql.SQLException;
import org.apache.derby.shared.common.i18n.MessageUtil;
@@ -303,7 +304,7 @@ public class SqlException extends Except
this(logWriter, (Throwable)null, reason, sqlState, errorCode);
}
- protected SqlException(LogWriter logWriter, java.lang.Throwable throwable,
+ protected SqlException(LogWriter logWriter, Throwable throwable,
String reason, String sqlState, int errorCode ) {
message_ = reason;
sqlstate_ = sqlState;
@@ -490,7 +491,7 @@ public class SqlException extends Except
}
}
- public void printTrace(java.io.PrintWriter printWriter, String header) {
+ public void printTrace(PrintWriter printWriter, String header) {
ExceptionFormatter.printTrace(this, printWriter, header);
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Sqlca.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Sqlca.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Sqlca.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Sqlca.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,8 @@ package org.apache.derby.client.am;
import java.io.UnsupportedEncodingException;
import java.sql.DataTruncation;
+import java.sql.Types;
+import java.util.Locale;
import org.apache.derby.client.net.Typdef;
import org.apache.derby.shared.common.error.ExceptionSeverity;
import org.apache.derby.shared.common.reference.SQLState;
@@ -35,7 +37,7 @@ public abstract class Sqlca {
public static final int LOW_ORDER_UPDATE_COUNT = 2;
public static final int HIGH_ORDER_UPDATE_COUNT = 3;
public static final int SQL_ERR_LENGTH = 6;
- transient protected Connection connection_;
+ transient protected ClientConnection connection_;
SqlException exceptionThrownOnStoredProcInvocation_;
boolean messageTextRetrievedContainsTokensOnly_ = true;
@@ -79,7 +81,7 @@ public abstract class Sqlca {
* procedure to get the same message). */
private String[] cachedMessages;
- protected Sqlca(Connection connection) {
+ protected Sqlca(ClientConnection connection) {
connection_ = connection;
agent_ = connection_ != null ? connection_.agent_ : null;
}
@@ -211,7 +213,7 @@ public abstract class Sqlca {
0,
sqlErrpBytes_.length);
return sqlErrp_;
- } catch (java.io.UnsupportedEncodingException e) {
+ } catch (UnsupportedEncodingException e) {
// leave sqlErrp as null.
return null;
}
@@ -282,7 +284,7 @@ public abstract class Sqlca {
return getUnformattedMessage(messageNumber);
}
- CallableStatement cs = null;
+ ClientCallableStatement cs = null;
synchronized (connection_) {
try {
cs = connection_.prepareMessageProc("call SYSIBM.SQLCAMESSAGE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
@@ -317,13 +319,13 @@ public abstract class Sqlca {
// MessageFileName: Not used by our driver, so set to null.
cs.setStringX(13, null);
// Locale: language preference requested for the return error message.
- cs.setStringX(14, java.util.Locale.getDefault().toString());
+ cs.setStringX(14, Locale.getDefault().toString());
// server could return a locale different from what we requested
- cs.registerOutParameterX(14, java.sql.Types.VARCHAR);
+ cs.registerOutParameterX(14, Types.VARCHAR);
// Message: error message returned from SQLCAMessage stored procedure.
- cs.registerOutParameterX(15, java.sql.Types.LONGVARCHAR);
+ cs.registerOutParameterX(15, Types.LONGVARCHAR);
// RCode: return code from SQLCAMessage stored procedure.
- cs.registerOutParameterX(16, java.sql.Types.INTEGER);
+ cs.registerOutParameterX(16, Types.INTEGER);
cs.executeX();
if (cs.getIntX(16) == 0) {
@@ -474,13 +476,13 @@ public abstract class Sqlca {
}
sqlStates_ = states;
sqlErrmcMessages_ = tokens;
- } catch (java.io.UnsupportedEncodingException e) {
+ } catch (UnsupportedEncodingException e) {
/* do nothing, the arrays continue to be null */
}
}
protected String bytes2String(byte[] bytes, int offset, int length)
- throws java.io.UnsupportedEncodingException {
+ throws UnsupportedEncodingException {
// Network server uses utf8 encoding
return new String(bytes, offset, length, Typdef.UTF8ENCODING);
}
@@ -508,7 +510,7 @@ public abstract class Sqlca {
return containsSqlcax_;
}
- public void resetRowsetSqlca(Connection connection,
+ public void resetRowsetSqlca(ClientConnection connection,
int sqlCode,
String sqlState) {
connection_ = connection;
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java Wed Apr 24 04:37:28 2013
@@ -21,6 +21,8 @@ limitations under the License.
package org.apache.derby.client.am;
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import org.apache.derby.client.am.stmtcache.JDBCStatementCache;
@@ -54,7 +56,7 @@ public final class StatementCacheInterac
* with this cache interactor to ensure the interactor methods are not
* invoked if the logical statement has been closed.
*/
- private final Connection physicalConnection;
+ private final ClientConnection physicalConnection;
/** List of open logical statements created by this cache interactor. */
//@GuardedBy("this")
private final ArrayList<LogicalStatementEntity> openLogicalStatements =
@@ -73,7 +75,7 @@ public final class StatementCacheInterac
* @param physicalConnection associated physical connection
*/
StatementCacheInteractor(JDBCStatementCache cache,
- Connection physicalConnection) {
+ ClientConnection physicalConnection) {
this.cache = cache;
this.physicalConnection = physicalConnection;
}
@@ -81,12 +83,12 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareStatement(String)
*/
- public synchronized java.sql.PreparedStatement prepareStatement(String sql)
+ public synchronized PreparedStatement prepareStatement(String sql)
throws SQLException {
StatementKey stmtKey = StatementKeyFactory.newPrepared(
sql, physicalConnection.getCurrentSchemaName(),
physicalConnection.holdability());
- java.sql.PreparedStatement ps = cache.getCached(stmtKey);
+ PreparedStatement ps = cache.getCached(stmtKey);
if (ps == null) {
ps = physicalConnection.prepareStatement(sql);
}
@@ -96,7 +98,7 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareStatement(String,int,int)
*/
- public synchronized java.sql.PreparedStatement prepareStatement(
+ public synchronized PreparedStatement prepareStatement(
String sql,
int resultSetType,
int resultSetConcurrency)
@@ -104,7 +106,7 @@ public final class StatementCacheInterac
StatementKey stmtKey = StatementKeyFactory.newPrepared(
sql, physicalConnection.getCurrentSchemaName(), resultSetType,
resultSetConcurrency, physicalConnection.holdability());
- java.sql.PreparedStatement ps = cache.getCached(stmtKey);
+ PreparedStatement ps = cache.getCached(stmtKey);
if (ps == null) {
ps = physicalConnection.prepareStatement(
sql, resultSetType, resultSetConcurrency);
@@ -115,7 +117,7 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareStatement(String,int,int,int)
*/
- public synchronized java.sql.PreparedStatement prepareStatement(
+ public synchronized PreparedStatement prepareStatement(
String sql,
int resultSetType,
int resultSetConcurrency,
@@ -125,7 +127,7 @@ public final class StatementCacheInterac
sql, physicalConnection.getCurrentSchemaName(), resultSetType,
resultSetConcurrency, resultSetHoldability);
- java.sql.PreparedStatement ps = cache.getCached(stmtKey);
+ PreparedStatement ps = cache.getCached(stmtKey);
if (ps == null) {
ps = physicalConnection.prepareStatement(
sql, resultSetType,resultSetConcurrency, resultSetHoldability);
@@ -136,14 +138,14 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareStatement(String,int)
*/
- public synchronized java.sql.PreparedStatement prepareStatement(
+ public synchronized PreparedStatement prepareStatement(
String sql,
int autoGeneratedKeys)
throws SQLException {
StatementKey stmtKey = StatementKeyFactory.newPrepared(
sql, physicalConnection.getCurrentSchemaName(),
physicalConnection.getHoldability(), autoGeneratedKeys);
- java.sql.PreparedStatement ps = cache.getCached(stmtKey);
+ PreparedStatement ps = cache.getCached(stmtKey);
if (ps == null) {
ps = physicalConnection.prepareStatement(sql, autoGeneratedKeys);
}
@@ -153,13 +155,13 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareCall(String)
*/
- public synchronized java.sql.CallableStatement prepareCall(String sql)
+ public synchronized CallableStatement prepareCall(String sql)
throws SQLException {
StatementKey stmtKey = StatementKeyFactory.newCallable(
sql, physicalConnection.getCurrentSchemaName(),
physicalConnection.holdability());
- java.sql.CallableStatement cs =
- (java.sql.CallableStatement)cache.getCached(stmtKey);
+ CallableStatement cs =
+ (CallableStatement)cache.getCached(stmtKey);
if (cs == null) {
cs = physicalConnection.prepareCall(sql);
@@ -170,15 +172,15 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareCall(String,int,int)
*/
- public synchronized java.sql.CallableStatement prepareCall(String sql,
+ public synchronized CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException {
StatementKey stmtKey = StatementKeyFactory.newCallable(
sql, physicalConnection.getCurrentSchemaName(), resultSetType,
resultSetConcurrency, physicalConnection.holdability());
- java.sql.CallableStatement cs =
- (java.sql.CallableStatement)cache.getCached(stmtKey);
+ CallableStatement cs =
+ (CallableStatement)cache.getCached(stmtKey);
if (cs == null) {
cs = physicalConnection.prepareCall(sql, resultSetType, resultSetConcurrency);
@@ -189,7 +191,7 @@ public final class StatementCacheInterac
/**
* @see java.sql.Connection#prepareCall(String,int,int,int)
*/
- public synchronized java.sql.CallableStatement prepareCall(String sql,
+ public synchronized CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
@@ -197,8 +199,8 @@ public final class StatementCacheInterac
StatementKey stmtKey = StatementKeyFactory.newCallable(
sql, physicalConnection.getCurrentSchemaName(), resultSetType,
resultSetConcurrency, resultSetHoldability);
- java.sql.CallableStatement cs =
- (java.sql.CallableStatement)cache.getCached(stmtKey);
+ CallableStatement cs =
+ (CallableStatement)cache.getCached(stmtKey);
if (cs == null) {
cs = physicalConnection.prepareCall(sql, resultSetType, resultSetConcurrency,
@@ -252,8 +254,8 @@ public final class StatementCacheInterac
* @return A logical prepared statement.
* @throws SQLException if creating a logical prepared statement fails
*/
- private java.sql.PreparedStatement createLogicalPreparedStatement(
- java.sql.PreparedStatement ps,
+ private PreparedStatement createLogicalPreparedStatement(
+ PreparedStatement ps,
StatementKey stmtKey) throws SQLException {
LogicalPreparedStatement logicalPs =
@@ -271,8 +273,8 @@ public final class StatementCacheInterac
* @return A logical callable statement.
* @throws SQLException if creating a logical callable statement fails
*/
- private java.sql.CallableStatement createLogicalCallableStatement(
- java.sql.CallableStatement cs,
+ private CallableStatement createLogicalCallableStatement(
+ CallableStatement cs,
StatementKey stmtKey) throws SQLException {
LogicalCallableStatement logicalCs =
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCallbackInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCallbackInterface.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCallbackInterface.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCallbackInterface.java Wed Apr 24 04:37:28 2013
@@ -31,9 +31,14 @@ package org.apache.derby.client.am;
public interface StatementCallbackInterface extends UnitOfWorkListener {
// A query has been opened on the server.
- public void completeOpenQuery(Sqlca sqlca, ResultSet resultSet) throws DisconnectException;
+ public void completeOpenQuery(Sqlca sqlca, ClientResultSet resultSet)
+ throws DisconnectException;
- public void completeExecuteCallOpenQuery(Sqlca sqlca, ResultSet resultSet, ColumnMetaData resultSetMetaData, Section generatedSection);
+ public void completeExecuteCallOpenQuery(
+ Sqlca sqlca,
+ ClientResultSet resultSet,
+ ColumnMetaData resultSetMetaData,
+ Section generatedSection);
// Chains a warning onto the statement.
public void accumulateWarning(SqlWarning e);
@@ -49,7 +54,10 @@ public interface StatementCallbackInterf
public void completeExecute(Sqlca sqlca);
- public void completeExecuteCall(Sqlca sqlca, Cursor params, ResultSet[] resultSets);
+ public void completeExecuteCall(
+ Sqlca sqlca,
+ Cursor params,
+ ClientResultSet[] resultSets);
public void completeExecuteCall(Sqlca sqlca, Cursor params);