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 [5/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/ap...
Copied: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement.java (from r1471244, db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement.java?p2=db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement.java&p1=db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java&r1=1471244&r2=1471245&rev=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement.java Wed Apr 24 04:37:28 2013
@@ -23,21 +23,35 @@ package org.apache.derby.client.am;
import java.io.InputStream;
import java.io.Reader;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URL;
+import java.sql.Array;
+import java.sql.BatchUpdateException;
+import java.sql.Blob;
+import java.sql.Clob;
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.Time;
import java.sql.Timestamp;
+import java.sql.Types;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
+import java.util.Iterator;
import org.apache.derby.client.ClientPooledConnection;
import org.apache.derby.jdbc.ClientDriver;
import org.apache.derby.shared.common.reference.SQLState;
import org.apache.derby.shared.common.sanity.SanityManager;
-public class PreparedStatement extends Statement
- implements java.sql.PreparedStatement,
- PreparedStatementCallbackInterface {
+public class ClientPreparedStatement extends ClientStatement
+ implements PreparedStatement, PreparedStatementCallbackInterface {
+
//---------------------navigational cheat-links-------------------------------
// Cheat-links are for convenience only, and are not part of the conceptual model.
// Warning:
@@ -157,8 +171,8 @@ public class PreparedStatement extends S
*
*/
- public PreparedStatement(Agent agent,
- Connection connection,
+ public ClientPreparedStatement(Agent agent,
+ ClientConnection connection,
String sql,
Section section,ClientPooledConnection cpc)
throws SqlException {
@@ -170,7 +184,7 @@ public class PreparedStatement extends S
}
public void resetPreparedStatement(Agent agent,
- Connection connection,
+ ClientConnection connection,
String sql,
Section section) throws SqlException {
super.resetStatement(agent, connection);
@@ -215,8 +229,8 @@ public class PreparedStatement extends S
* ClientPooledConnection.
* @throws SqlException
*/
- public PreparedStatement(Agent agent,
- Connection connection,
+ public ClientPreparedStatement(Agent agent,
+ ClientConnection connection,
String sql,
int type, int concurrency, int holdability,
int autoGeneratedKeys, String[] columnNames,
@@ -233,7 +247,7 @@ public class PreparedStatement extends S
public void resetPreparedStatement(Agent agent,
- Connection connection,
+ ClientConnection connection,
String sql,
int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames,
int[] columnIndexes) throws SqlException {
@@ -291,7 +305,7 @@ public class PreparedStatement extends S
}
public void resetPreparedStatement(Agent agent,
- Connection connection,
+ ClientConnection connection,
String sql,
Section section,
ColumnMetaData parameterMetaData,
@@ -345,7 +359,7 @@ public class PreparedStatement extends S
"execute(String)").getSQLException();
}
- public java.sql.ResultSet executeQuery(String sql) throws SQLException {
+ public ResultSet executeQuery(String sql) throws SQLException {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "executeQuery", sql);
}
@@ -364,14 +378,14 @@ public class PreparedStatement extends S
}
// ---------------------------jdbc 1------------------------------------------
- public java.sql.ResultSet executeQuery() throws SQLException {
+ public ResultSet executeQuery() throws SQLException {
try
{
synchronized (connection_) {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "executeQuery");
}
- ResultSet resultSet = executeQueryX();
+ ClientResultSet resultSet = executeQueryX();
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceExit(this, "executeQuery", resultSet);
}
@@ -385,7 +399,7 @@ public class PreparedStatement extends S
}
// also called by some DBMD methods
- ResultSet executeQueryX() throws SqlException {
+ ClientResultSet executeQueryX() throws SqlException {
flowExecute(executeQueryMethod__);
return resultSet_;
}
@@ -489,12 +503,13 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.BOOLEAN,
+ Types.BOOLEAN,
paramType);
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BIT;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.BIT;
setInput(parameterIndex, Boolean.valueOf(x));
}
}
@@ -518,12 +533,13 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.TINYINT,
+ Types.TINYINT,
paramType);
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TINYINT;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.TINYINT;
setInput(parameterIndex, Short.valueOf(x));
}
}
@@ -547,7 +563,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.SMALLINT,
+ Types.SMALLINT,
paramType);
@@ -564,7 +580,8 @@ public class PreparedStatement extends S
// also used by DBMD methods
void setShortX(int parameterIndex, short x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.SMALLINT;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.SMALLINT;
setInput(parameterIndex, x);
}
@@ -583,7 +600,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.INTEGER,
+ Types.INTEGER,
paramType);
}
@@ -598,7 +615,8 @@ public class PreparedStatement extends S
// also used by DBMD methods
void setIntX(int parameterIndex, int x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.INTEGER;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.INTEGER;
setInput(parameterIndex, x);
}
@@ -617,7 +635,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.INTEGER,
+ Types.INTEGER,
paramType);
}
setLongX(parameterIndex, x);
@@ -633,7 +651,7 @@ public class PreparedStatement extends S
{
// Column numbers starts at 1, clientParamtertype_[0] refers to column 1
parameterMetaData_.clientParamtertype_[parameterIndex - 1]
- = java.sql.Types.BIGINT;
+ = Types.BIGINT;
setInput(parameterIndex, x);
}
@@ -651,12 +669,13 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.FLOAT,
+ Types.FLOAT,
paramType);
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.REAL;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.REAL;
setInput(parameterIndex, x);
}
}
@@ -680,12 +699,13 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.DOUBLE,
+ Types.DOUBLE,
paramType);
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DOUBLE;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.DOUBLE;
setInput(parameterIndex, new Double(x));
}
}
@@ -695,7 +715,8 @@ public class PreparedStatement extends S
}
}
- public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {
+ public void setBigDecimal(int parameterIndex, BigDecimal x)
+ throws SQLException {
try
{
synchronized (connection_) {
@@ -709,14 +730,16 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.BIGINT,
+ Types.BIGINT,
paramType);
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DECIMAL;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.DECIMAL;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.DECIMAL);
+ setNull(parameterIndex, Types.DECIMAL);
return;
}
int registerOutScale = 0;
@@ -745,7 +768,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_DATE.checkType(paramType) ){
PossibleTypes.throw22005Exception(agent_.logWriter_ ,
- java.sql.Types.DATE,
+ Types.DATE,
paramType);
}
@@ -758,9 +781,11 @@ public class PreparedStatement extends S
"null", "calendar", "setDate()");
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DATE;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.DATE;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.DATE);
+ setNull(parameterIndex, Types.DATE);
return;
}
setInput(parameterIndex, new DateTimeValue(x, calendar));
@@ -791,7 +816,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIME.checkType( paramType ) ){
PossibleTypes.throw22005Exception( agent_.logWriter_,
- java.sql.Types.TIME,
+ Types.TIME,
paramType );
}
@@ -801,9 +826,11 @@ public class PreparedStatement extends S
"null", "calendar", "setTime()");
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TIME;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.TIME;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.TIME);
+ setNull(parameterIndex, Types.TIME);
return;
}
setInput(parameterIndex, new DateTimeValue(x, calendar));
@@ -835,7 +862,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIMESTAMP.checkType( paramType ) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.TIMESTAMP,
+ Types.TIMESTAMP,
paramType);
}
@@ -846,10 +873,11 @@ public class PreparedStatement extends S
"null", "calendar", "setTimestamp()");
}
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TIMESTAMP;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.TIMESTAMP;
if (x == null) {
- setNull(parameterIndex, java.sql.Types.TIMESTAMP);
+ setNull(parameterIndex, Types.TIMESTAMP);
return;
}
setInput(parameterIndex, new DateTimeValue(x, calendar));
@@ -879,7 +907,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_STRING.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_ ,
- java.sql.Types.VARCHAR,
+ Types.VARCHAR,
paramType);
}
@@ -894,9 +922,11 @@ public class PreparedStatement extends S
// also used by DBMD methods
void setStringX(int parameterIndex, String x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.LONGVARCHAR;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.LONGVARCHAR;
+
if (x == null) {
- setNullX(parameterIndex, java.sql.Types.LONGVARCHAR);
+ setNullX(parameterIndex, Types.LONGVARCHAR);
return;
}
setInput(parameterIndex, x);
@@ -916,7 +946,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BYTES.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.VARBINARY,
+ Types.VARBINARY,
paramType );
}
@@ -931,9 +961,11 @@ public class PreparedStatement extends S
// also used by BLOB
public void setBytesX(int parameterIndex, byte[] x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.LONGVARBINARY;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.LONGVARBINARY;
+
if (x == null) {
- setNullX(parameterIndex, java.sql.Types.LONGVARBINARY);
+ setNullX(parameterIndex, Types.LONGVARBINARY);
return;
}
setInput(parameterIndex, x);
@@ -950,7 +982,7 @@ public class PreparedStatement extends S
*/
public void setBinaryStream(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
long length) throws SQLException {
try
{
@@ -982,27 +1014,27 @@ public class PreparedStatement extends S
*/
public void setBinaryStream(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
int length) throws SQLException {
setBinaryStream(parameterIndex,x,(long)length);
}
protected void setBinaryStreamX(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
int length) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BLOB;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] = Types.BLOB;
if (x == null) {
- setNullX(parameterIndex, java.sql.Types.BLOB);
+ setNullX(parameterIndex, Types.BLOB);
return;
}
- Blob blob;
+ ClientBlob blob;
if (length == -1) {
// Create a blob of unknown length. This might cause an
// OutOfMemoryError due to the temporary implementation in Blob.
// The whole stream will be materialzied. See comments in Blob.
- blob = new Blob(agent_, x);
+ blob = new ClientBlob(agent_, x);
} else {
- blob = new Blob(agent_, x, length);
+ blob = new ClientBlob(agent_, x, length);
}
setInput(parameterIndex, blob);
}
@@ -1018,7 +1050,7 @@ public class PreparedStatement extends S
*/
public void setAsciiStream(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
long length) throws SQLException {
try
{
@@ -1030,13 +1062,16 @@ public class PreparedStatement extends S
checkTypeForSetAsciiStream(parameterIndex);
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.CLOB;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
+ setNull(parameterIndex, Types.LONGVARCHAR);
return;
}
checkStreamLength(length);
- setInput(parameterIndex, new Clob(agent_, x, "ISO-8859-1", (int)length));
+ setInput(parameterIndex,
+ new ClientClob(agent_, x, "ISO-8859-1", (int)length));
}
}
catch ( SqlException se )
@@ -1055,7 +1090,7 @@ public class PreparedStatement extends S
* @exception SQLException thrown on failure.
*/
public void setAsciiStream(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
int length) throws SQLException {
setAsciiStream(parameterIndex,x,(long)length);
}
@@ -1090,7 +1125,7 @@ public class PreparedStatement extends S
if ( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_ASCIISTREAM.checkType( paramType ) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.LONGVARCHAR,
+ Types.LONGVARCHAR,
paramType);
@@ -1103,7 +1138,7 @@ public class PreparedStatement extends S
if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM.
checkType(paramType)) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.VARBINARY,
+ Types.VARBINARY,
paramType);
}
}
@@ -1114,7 +1149,7 @@ public class PreparedStatement extends S
if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM.
checkType(paramType)) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.LONGVARCHAR,
+ Types.LONGVARCHAR,
paramType);
}
}
@@ -1125,7 +1160,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BLOB.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.BLOB,
+ Types.BLOB,
paramType);
}
}
@@ -1137,7 +1172,7 @@ public class PreparedStatement extends S
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CLOB.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
- java.sql.Types.CLOB,
+ Types.CLOB,
paramType);
}
@@ -1158,7 +1193,7 @@ public class PreparedStatement extends S
* @deprecated
*/
public void setUnicodeStream(int parameterIndex,
- java.io.InputStream x,
+ InputStream x,
int length) throws SQLException {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceDeprecatedEntry(this, "setUnicodeStream",
@@ -1193,12 +1228,12 @@ public class PreparedStatement extends S
try {
checkTypeForSetCharacterStream(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex -1] =
- java.sql.Types.CLOB;
+ Types.CLOB;
if (x == null) {
- setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
+ setNull(parameterIndex, Types.LONGVARCHAR);
return;
}
- setInput(parameterIndex, new Clob(agent_, x));
+ setInput(parameterIndex, new ClientClob(agent_, x));
} catch (SqlException se) {
throw se.getSQLException();
}
@@ -1218,7 +1253,7 @@ public class PreparedStatement extends S
*/
public void setCharacterStream(int parameterIndex,
- java.io.Reader x,
+ Reader x,
long length) throws SQLException {
try
{
@@ -1228,13 +1263,16 @@ public class PreparedStatement extends S
parameterIndex, x, Long.valueOf(length));
}
checkTypeForSetCharacterStream(parameterIndex);
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.CLOB;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
+ setNull(parameterIndex, Types.LONGVARCHAR);
return;
}
checkStreamLength(length);
- setInput(parameterIndex, new Clob(agent_, x, (int)length));
+ setInput(parameterIndex,
+ new ClientClob(agent_, x, (int)length));
}
}
catch ( SqlException se )
@@ -1256,12 +1294,12 @@ public class PreparedStatement extends S
*/
public void setCharacterStream(int parameterIndex,
- java.io.Reader x,
+ Reader x,
int length) throws SQLException {
setCharacterStream(parameterIndex,x,(long)length);
}
- public void setBlob(int parameterIndex, java.sql.Blob x) throws SQLException {
+ public void setBlob(int parameterIndex, Blob x) throws SQLException {
try
{
synchronized (connection_) {
@@ -1280,16 +1318,16 @@ public class PreparedStatement extends S
}
// also used by Blob
- public void setBlobX(int parameterIndex, java.sql.Blob x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BLOB;
+ public void setBlobX(int parameterIndex, Blob x) throws SqlException {
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] = Types.BLOB;
if (x == null) {
- setNullX(parameterIndex, java.sql.Types.BLOB);
+ setNullX(parameterIndex, Types.BLOB);
return;
}
setInput(parameterIndex, x);
}
- public void setClob(int parameterIndex, java.sql.Clob x) throws SQLException {
+ public void setClob(int parameterIndex, Clob x) throws SQLException {
try
{
synchronized (connection_) {
@@ -1307,17 +1345,17 @@ public class PreparedStatement extends S
}
// also used by Clob
- void setClobX(int parameterIndex, java.sql.Clob x) throws SqlException {
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
+ void setClobX(int parameterIndex, Clob x) throws SqlException {
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] = Types.CLOB;
if (x == null) {
- this.setNullX(parameterIndex, Types.CLOB);
+ this.setNullX(parameterIndex, ClientTypes.CLOB);
return;
}
setInput(parameterIndex, x);
}
- public void setArray(int parameterIndex, java.sql.Array x) throws SQLException {
+ public void setArray(int parameterIndex, Array x) throws SQLException {
try
{
synchronized (connection_) {
@@ -1334,7 +1372,7 @@ public class PreparedStatement extends S
}
}
- public void setRef(int parameterIndex, java.sql.Ref x) throws SQLException {
+ public void setRef(int parameterIndex, Ref x) throws SQLException {
try
{
synchronized (connection_) {
@@ -1364,7 +1402,7 @@ public class PreparedStatement extends S
int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
- if ( paramType == java.sql.Types.JAVA_OBJECT )
+ if ( paramType == Types.JAVA_OBJECT )
{
setUDTX( parameterIndex, x );
} else if (x == null) {
@@ -1386,30 +1424,34 @@ public class PreparedStatement extends S
setLong(parameterIndex, ((Long) x).longValue());
} else if (x instanceof byte[]) {
setBytes(parameterIndex, (byte[]) x);
- } else if (x instanceof java.math.BigDecimal) {
- setBigDecimal(parameterIndex, (java.math.BigDecimal) x);
- } else if (x instanceof java.sql.Date) {
- setDate(parameterIndex, (java.sql.Date) x);
- } else if (x instanceof java.sql.Time) {
- setTime(parameterIndex, (java.sql.Time) x);
- } else if (x instanceof java.sql.Timestamp) {
- setTimestamp(parameterIndex, (java.sql.Timestamp) x);
- } else if (x instanceof java.sql.Blob) {
- setBlob(parameterIndex, (java.sql.Blob) x);
- } else if (x instanceof java.sql.Clob) {
- setClob(parameterIndex, (java.sql.Clob) x);
- } else if (x instanceof java.sql.Array) {
- setArray(parameterIndex, (java.sql.Array) x);
- } else if (x instanceof java.sql.Ref) {
- setRef(parameterIndex, (java.sql.Ref) x);
+ } else if (x instanceof BigDecimal) {
+ setBigDecimal(parameterIndex, (BigDecimal) x);
+ } else if (x instanceof Date) {
+ setDate(parameterIndex, (Date) x);
+ } else if (x instanceof Time) {
+ setTime(parameterIndex, (Time) x);
+ } else if (x instanceof Timestamp) {
+ setTimestamp(parameterIndex, (Timestamp) x);
+ } else if (x instanceof Blob) {
+ setBlob(parameterIndex, (Blob) x);
+ } else if (x instanceof Clob) {
+ setClob(parameterIndex, (Clob) x);
+ } else if (x instanceof Array) {
+ setArray(parameterIndex, (Array) x);
+ } else if (x instanceof Ref) {
+ setRef(parameterIndex, (Ref) x);
} else if (x instanceof Short) {
setShort(parameterIndex, ((Short) x).shortValue());
- } else if (x instanceof java.math.BigInteger) {
- setBigDecimal(parameterIndex, new java.math.BigDecimal( (java.math.BigInteger) x ) );
+ } else if (x instanceof BigInteger) {
+ setBigDecimal(parameterIndex,
+ new BigDecimal((BigInteger)x));
} else if (x instanceof java.util.Date) {
- setTimestamp(parameterIndex, new Timestamp( ((java.util.Date) x).getTime() ) );
- } else if (x instanceof java.util.Calendar) {
- setTimestamp(parameterIndex, new Timestamp( ((java.util.Calendar) x).getTime().getTime() ) );
+ setTimestamp(parameterIndex,
+ new Timestamp(((java.util.Date)x).getTime()));
+ } else if (x instanceof Calendar) {
+ setTimestamp(
+ parameterIndex,
+ new Timestamp(((Calendar)x).getTime().getTime()));
} else if (x instanceof Byte) {
setByte(parameterIndex, ((Byte) x).byteValue());
} else {
@@ -1432,7 +1474,7 @@ public class PreparedStatement extends S
private void setUDTX(int parameterIndex, Object x) throws SqlException, SQLException
{
int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
- int expectedType = java.sql.Types.JAVA_OBJECT;
+ int expectedType = Types.JAVA_OBJECT;
if ( !( paramType == expectedType ) )
{
@@ -1535,8 +1577,9 @@ public class PreparedStatement extends S
// Set to round down on setScale like embedded does in SQLDecimal
try {
- if (targetJdbcType == java.sql.Types.DECIMAL || targetJdbcType == java.sql.Types.NUMERIC) {
- x = ((java.math.BigDecimal) x).setScale(scale, java.math.BigDecimal.ROUND_DOWN);
+ if (targetJdbcType == Types.DECIMAL ||
+ targetJdbcType == Types.NUMERIC) {
+ x = ((BigDecimal) x).setScale(scale, BigDecimal.ROUND_DOWN);
}
} catch (ArithmeticException ae) {
// Any problems with scale should have already been caught by
@@ -1668,7 +1711,7 @@ public class PreparedStatement extends S
}
}
- public java.sql.ResultSetMetaData getMetaData() throws SQLException {
+ public ResultSetMetaData getMetaData() throws SQLException {
try
{
synchronized (connection_) {
@@ -1749,14 +1792,14 @@ public class PreparedStatement extends S
"execute(String, int[])").getSQLException();
}
- public void setURL(int parameterIndex, java.net.URL x) throws SQLException {
+ public void setURL(int parameterIndex, URL x) throws SQLException {
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "setURL", parameterIndex, x);
}
jdbc3FeatureNotSupported(false);
}
- public java.sql.ParameterMetaData getParameterMetaData() throws SQLException {
+ public ParameterMetaData getParameterMetaData() throws SQLException {
try
{
synchronized (connection_) {
@@ -1767,7 +1810,7 @@ public class PreparedStatement extends S
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceExit(this, "getParameterMetaData", parameterMetaData);
}
- return (java.sql.ParameterMetaData) parameterMetaData;
+ return (ParameterMetaData) parameterMetaData;
}
}
catch ( SqlException se )
@@ -1776,9 +1819,11 @@ public class PreparedStatement extends S
}
}
- private ParameterMetaData getParameterMetaDataX() throws SqlException {
- ParameterMetaData pm = ClientDriver.getFactory().newParameterMetaData
- ( getColumnMetaDataX() );
+ private ClientParameterMetaData getParameterMetaDataX()
+ throws SqlException {
+ ClientParameterMetaData pm =
+ ClientDriver.getFactory().
+ newParameterMetaData(getColumnMetaDataX());
return pm;
}
@@ -2009,7 +2054,7 @@ public class PreparedStatement extends S
boolean commitSubstituted = false;
boolean repositionedCursor = false;
boolean timeoutSent = false;
- ResultSet scrollableRS = null;
+ ClientResultSet scrollableRS = null;
if (doWriteTimeout) {
timeoutArrayList.set(0, TIMEOUT_STATEMENT + timeout_);
@@ -2201,7 +2246,7 @@ public class PreparedStatement extends S
private long[] executeBatchRequestX(boolean supportsQueryBatchRequest)
- throws SqlException, java.sql.BatchUpdateException {
+ throws SqlException, BatchUpdateException {
SqlException chainBreaker = null;
int batchSize = batch_.size();
long[] updateCounts = new long[batchSize];
@@ -2248,7 +2293,7 @@ public class PreparedStatement extends S
if (sqlMode_ == isQuery__) {
indexOfCurrentResultSet_ = -1; //reset ResultSetList
- resultSetList_ = new ResultSet[batchSize];
+ resultSetList_ = new ClientResultSet[batchSize];
}
@@ -2380,7 +2425,7 @@ public class PreparedStatement extends S
}
}
- public void completeLocalCommit(java.util.Iterator listenerIterator) {
+ public void completeLocalCommit(Iterator listenerIterator) {
if (section_ != null) {
openOnServer_ = false;
}
@@ -2388,7 +2433,7 @@ public class PreparedStatement extends S
listenToUnitOfWork_ = false;
}
- public void completeLocalRollback(java.util.Iterator listenerIterator) {
+ public void completeLocalRollback(Iterator listenerIterator) {
if (section_ != null) {
openOnServer_ = false;
}
@@ -2428,7 +2473,7 @@ public class PreparedStatement extends S
if (!parameterSet_[i] &&
(!parameterRegistered_[i] ||
parameterMetaData_.sqlxParmmode_[i] ==
- java.sql.ParameterMetaData.parameterModeInOut)) {
+ ClientParameterMetaData.parameterModeInOut)) {
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.LANG_MISSING_PARMS));
}
@@ -2444,7 +2489,7 @@ public class PreparedStatement extends S
}
void checkScaleForINOUTDecimal(int parameterIndex, int registerOutScale) throws SqlException {
- java.math.BigDecimal decimalInput = (java.math.BigDecimal) parameters_[parameterIndex - 1];
+ BigDecimal decimalInput = (BigDecimal) parameters_[parameterIndex - 1];
if (decimalInput == null) {
return;
}
@@ -2531,12 +2576,15 @@ public class PreparedStatement extends S
}
try {
checkTypeForSetAsciiStream(parameterIndex);
- parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
+ parameterMetaData_.clientParamtertype_[parameterIndex - 1] =
+ Types.CLOB;
+
if (x == null) {
- setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
+ setNull(parameterIndex, Types.LONGVARCHAR);
return;
}
- setInput(parameterIndex, new Clob(agent_, x, "ISO-8859-1"));
+ setInput(parameterIndex,
+ new ClientClob(agent_, x, "ISO-8859-1"));
} catch (SqlException se) {
throw se.getSQLException();
}
@@ -2598,7 +2646,7 @@ public class PreparedStatement extends S
} catch (SqlException se) {
throw se.getSQLException();
}
- setInput(parameterIndex, new Clob(agent_, reader));
+ setInput(parameterIndex, new ClientClob(agent_, reader));
}
}
@@ -2630,7 +2678,8 @@ public class PreparedStatement extends S
new ClientMessageId(SQLState.BLOB_TOO_LARGE_FOR_CLIENT),
length, Integer.MAX_VALUE).getSQLException();
else
- setInput(parameterIndex, new Clob(agent_, reader, (int)length));
+ setInput(parameterIndex,
+ new ClientClob(agent_, reader, (int)length));
}
}
@@ -2798,280 +2847,280 @@ public class PreparedStatement extends S
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR =
new PossibleTypes( new int[] {
- java.sql.Types.BIGINT,
- java.sql.Types.LONGVARCHAR ,
- java.sql.Types.CHAR,
- java.sql.Types.DECIMAL,
- java.sql.Types.INTEGER,
- java.sql.Types.SMALLINT,
- java.sql.Types.REAL,
- java.sql.Types.DOUBLE,
- java.sql.Types.VARCHAR,
- java.sql.Types.BOOLEAN } );
+ Types.BIGINT,
+ Types.LONGVARCHAR ,
+ Types.CHAR,
+ Types.DECIMAL,
+ Types.INTEGER,
+ Types.SMALLINT,
+ Types.REAL,
+ Types.DOUBLE,
+ Types.VARCHAR,
+ Types.BOOLEAN } );
/**
* This is possibleTypes of variable which can be set by setDate method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_DATE =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.DATE,
- java.sql.Types.TIMESTAMP } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.DATE,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of variable which can be set by setTime method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_TIME =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.TIME } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.TIME } );
/**
* This is possibleTypes of variable which can be set by setTimestamp method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_TIMESTAMP =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.DATE,
- java.sql.Types.TIME,
- java.sql.Types.TIMESTAMP } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.DATE,
+ Types.TIME,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of variable which can be set by setString method.
*/
final private static PossibleTypes POSSIBLE_TYPES_IN_SET_STRING =
new PossibleTypes( new int[] {
- java.sql.Types.BIGINT,
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.DECIMAL,
- java.sql.Types.INTEGER,
- java.sql.Types.SMALLINT,
- java.sql.Types.REAL,
- java.sql.Types.DOUBLE,
- java.sql.Types.VARCHAR,
- java.sql.Types.BOOLEAN,
- java.sql.Types.DATE,
- java.sql.Types.TIME,
- java.sql.Types.TIMESTAMP,
- java.sql.Types.CLOB } );
+ Types.BIGINT,
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.DECIMAL,
+ Types.INTEGER,
+ Types.SMALLINT,
+ Types.REAL,
+ Types.DOUBLE,
+ Types.VARCHAR,
+ Types.BOOLEAN,
+ Types.DATE,
+ Types.TIME,
+ Types.TIMESTAMP,
+ Types.CLOB } );
/**
* This is possibleTypes of variable which can be set by setBytes method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_BYTES =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARBINARY,
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.BLOB } );
+ Types.LONGVARBINARY,
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.BLOB } );
/**
* This is possibleTypes of variable which can be set by setBinaryStream method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_BINARYSTREAM =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARBINARY,
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.BLOB } );
+ Types.LONGVARBINARY,
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.BLOB } );
/**
* This is possibleTypes of variable which can be set by setAsciiStream method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_ASCIISTREAM =
new PossibleTypes( new int[]{
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.CLOB } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.CLOB } );
/**
* This is possibleTypes of variable which can be set by setCharacterStream method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.CLOB } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.CLOB } );
/**
* This is possibleTypes of variable which can be set by setBlob method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_BLOB =
new PossibleTypes( new int[] {
- java.sql.Types.BLOB } );
+ Types.BLOB } );
/**
* This is possibleTypes of variable which can be set by setClob method.
*/
final public static PossibleTypes POSSIBLE_TYPES_IN_SET_CLOB =
new PossibleTypes( new int[] {
- java.sql.Types.CLOB } );
+ Types.CLOB } );
/**
* This is possibleTypes of null value which can be assigned to generic scalar typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.BIT,
- java.sql.Types.TINYINT,
- java.sql.Types.BIGINT,
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.NUMERIC,
- java.sql.Types.DECIMAL,
- java.sql.Types.INTEGER,
- java.sql.Types.SMALLINT,
- java.sql.Types.FLOAT,
- java.sql.Types.REAL,
- java.sql.Types.DOUBLE,
- java.sql.Types.VARCHAR } );
+ Types.BIT,
+ Types.TINYINT,
+ Types.BIGINT,
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.NUMERIC,
+ Types.DECIMAL,
+ Types.INTEGER,
+ Types.SMALLINT,
+ Types.FLOAT,
+ Types.REAL,
+ Types.DOUBLE,
+ Types.VARCHAR } );
/**
* This is possibleTypes of null value which can be assigned to generic character typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_GENERIC_CHARACTERS_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.BIT,
- java.sql.Types.TINYINT,
- java.sql.Types.BIGINT,
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.NUMERIC,
- java.sql.Types.DECIMAL,
- java.sql.Types.INTEGER,
- java.sql.Types.SMALLINT,
- java.sql.Types.FLOAT,
- java.sql.Types.REAL,
- java.sql.Types.DOUBLE,
- java.sql.Types.VARCHAR,
- java.sql.Types.DATE,
- java.sql.Types.TIME,
- java.sql.Types.TIMESTAMP } );
+ Types.BIT,
+ Types.TINYINT,
+ Types.BIGINT,
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.NUMERIC,
+ Types.DECIMAL,
+ Types.INTEGER,
+ Types.SMALLINT,
+ Types.FLOAT,
+ Types.REAL,
+ Types.DOUBLE,
+ Types.VARCHAR,
+ Types.DATE,
+ Types.TIME,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of null value which can be assigned to VARBINARY typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_VARBINARY_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.LONGVARBINARY } );
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.LONGVARBINARY } );
/**
* This is possibleTypes of null value which can be assigned to BINARY typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_BINARY_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.LONGVARBINARY } );
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.LONGVARBINARY } );
/**
* This is possibleTypes of null value which can be assigned to LONGVARBINARY typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_LONGVARBINARY_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.LONGVARBINARY } );
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.LONGVARBINARY } );
/**
* This is possibleTypes of null value which can be assigned to DATE typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_DATE_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.DATE,
- java.sql.Types.TIMESTAMP } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.DATE,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of null value which can be assigned to TIME typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_TIME_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.TIME,
- java.sql.Types.TIMESTAMP } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.TIME,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of null value which can be assigned to TIMESTAMP typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_TIMESTAMP_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.DATE,
- java.sql.Types.TIMESTAMP } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.DATE,
+ Types.TIMESTAMP } );
/**
* This is possibleTypes of null value which can be assigned to CLOB typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_CLOB_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.CHAR,
- java.sql.Types.VARCHAR,
- java.sql.Types.CLOB } );
+ Types.LONGVARCHAR,
+ Types.CHAR,
+ Types.VARCHAR,
+ Types.CLOB } );
/**
* This is possibleTypes of null value which can be assigned to BLOB typed variable.
*/
final public static PossibleTypes POSSIBLE_TYPES_FOR_BLOB_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.BLOB } );
+ Types.BLOB } );
/**
* This is possibleTypes of null value which can be assigned to other typed variable.
*/
final public static PossibleTypes DEFAULT_POSSIBLE_TYPES_FOR_NULL =
new PossibleTypes( new int[] {
- java.sql.Types.BIT,
- java.sql.Types.TINYINT,
- java.sql.Types.BIGINT,
- java.sql.Types.LONGVARBINARY,
- java.sql.Types.VARBINARY,
- java.sql.Types.BINARY,
- java.sql.Types.LONGVARCHAR,
- java.sql.Types.NULL,
- java.sql.Types.CHAR,
- java.sql.Types.NUMERIC,
- java.sql.Types.DECIMAL,
- java.sql.Types.INTEGER,
- java.sql.Types.SMALLINT,
- java.sql.Types.FLOAT,
- java.sql.Types.REAL,
- java.sql.Types.DOUBLE,
- java.sql.Types.VARCHAR,
- java.sql.Types.BOOLEAN,
- java.sql.Types.DATALINK,
- java.sql.Types.DATE,
- java.sql.Types.TIME,
- java.sql.Types.TIMESTAMP,
- java.sql.Types.OTHER,
- java.sql.Types.JAVA_OBJECT,
- java.sql.Types.DISTINCT,
- java.sql.Types.STRUCT,
- java.sql.Types.ARRAY,
- java.sql.Types.BLOB,
- java.sql.Types.CLOB,
- java.sql.Types.REF } );
+ Types.BIT,
+ Types.TINYINT,
+ Types.BIGINT,
+ Types.LONGVARBINARY,
+ Types.VARBINARY,
+ Types.BINARY,
+ Types.LONGVARCHAR,
+ Types.NULL,
+ Types.CHAR,
+ Types.NUMERIC,
+ Types.DECIMAL,
+ Types.INTEGER,
+ Types.SMALLINT,
+ Types.FLOAT,
+ Types.REAL,
+ Types.DOUBLE,
+ Types.VARCHAR,
+ Types.BOOLEAN,
+ Types.DATALINK,
+ Types.DATE,
+ Types.TIME,
+ Types.TIMESTAMP,
+ Types.OTHER,
+ Types.JAVA_OBJECT,
+ Types.DISTINCT,
+ Types.STRUCT,
+ Types.ARRAY,
+ Types.BLOB,
+ Types.CLOB,
+ Types.REF } );
/**
* This method return true if the type is possible.
@@ -3103,8 +3152,8 @@ public class PreparedStatement extends S
throw new SqlException( logWriter,
new ClientMessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH) ,
new Object[]{
- Types.getTypeString(valType),
- Types.getTypeString(paramType)
+ ClientTypes.getTypeString(valType),
+ ClientTypes.getTypeString(paramType)
},
(Throwable) null);
}
@@ -3117,58 +3166,58 @@ public class PreparedStatement extends S
switch(typeOfVariable){
- case java.sql.Types.SMALLINT:
+ case Types.SMALLINT:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.INTEGER:
+ case Types.INTEGER:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.BIGINT:
+ case Types.BIGINT:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.REAL:
+ case Types.REAL:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.FLOAT:
+ case Types.FLOAT:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.DOUBLE:
+ case Types.DOUBLE:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.DECIMAL:
+ case Types.DECIMAL:
return POSSIBLE_TYPES_FOR_GENERIC_SCALAR_NULL;
- case java.sql.Types.CHAR:
+ case Types.CHAR:
return POSSIBLE_TYPES_FOR_GENERIC_CHARACTERS_NULL;
- case java.sql.Types.VARCHAR:
+ case Types.VARCHAR:
return POSSIBLE_TYPES_FOR_GENERIC_CHARACTERS_NULL;
- case java.sql.Types.LONGVARCHAR:
+ case Types.LONGVARCHAR:
return POSSIBLE_TYPES_FOR_GENERIC_CHARACTERS_NULL;
- case java.sql.Types.VARBINARY:
+ case Types.VARBINARY:
return POSSIBLE_TYPES_FOR_VARBINARY_NULL;
- case java.sql.Types.BINARY:
+ case Types.BINARY:
return POSSIBLE_TYPES_FOR_BINARY_NULL;
- case java.sql.Types.LONGVARBINARY:
+ case Types.LONGVARBINARY:
return POSSIBLE_TYPES_FOR_LONGVARBINARY_NULL;
- case java.sql.Types.DATE:
+ case Types.DATE:
return POSSIBLE_TYPES_FOR_DATE_NULL;
- case java.sql.Types.TIME:
+ case Types.TIME:
return POSSIBLE_TYPES_FOR_TIME_NULL;
- case java.sql.Types.TIMESTAMP:
+ case Types.TIMESTAMP:
return POSSIBLE_TYPES_FOR_TIMESTAMP_NULL;
- case java.sql.Types.CLOB:
+ case Types.CLOB:
return POSSIBLE_TYPES_FOR_CLOB_NULL;
- case java.sql.Types.BLOB:
+ case Types.BLOB:
return POSSIBLE_TYPES_FOR_BLOB_NULL;
}
Copied: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement40.java (from r1471244, db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement40.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement40.java?p2=db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement40.java&p1=db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement40.java&r1=1471244&r2=1471245&rev=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement40.java Wed Apr 24 04:37:28 2013
@@ -27,7 +27,7 @@ import java.sql.SQLException;
import java.sql.SQLXML;
import org.apache.derby.client.ClientPooledConnection;
-public class PreparedStatement40 extends PreparedStatement {
+public class ClientPreparedStatement40 extends ClientPreparedStatement{
/**
* The PreparedStatement used for JDBC 4 positioned update statements.
@@ -50,8 +50,8 @@ public class PreparedStatement40 extends
* ClientPooledConnection.
* @throws SqlException
*/
- public PreparedStatement40(Agent agent,
- Connection connection,
+ public ClientPreparedStatement40(Agent agent,
+ ClientConnection connection,
String sql,
Section section,ClientPooledConnection cpc) throws SqlException {
super(agent, connection,sql,section,cpc);
@@ -86,8 +86,8 @@ public class PreparedStatement40 extends
* ClientPooledConnection.
* @throws SqlException
*/
- public PreparedStatement40(Agent agent,
- Connection connection,
+ public ClientPreparedStatement40(Agent agent,
+ ClientConnection connection,
String sql,
int type, int concurrency, int holdability, int autoGeneratedKeys,
String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException {
Copied: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement42.java (from r1471244, db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement42.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement42.java?p2=db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement42.java&p1=db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement42.java&r1=1471244&r2=1471245&rev=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement42.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientPreparedStatement42.java Wed Apr 24 04:37:28 2013
@@ -25,7 +25,7 @@ import java.sql.SQLException;
import java.sql.SQLType;
import org.apache.derby.client.ClientPooledConnection;
-public class PreparedStatement42 extends PreparedStatement40
+public class ClientPreparedStatement42 extends ClientPreparedStatement40
{
/**
* The PreparedStatement used for JDBC 4.2 positioned update statements.
@@ -34,9 +34,9 @@ public class PreparedStatement42 extends
* this is used to raise the Statement Events when the prepared
* statement is closed
*/
- public PreparedStatement42
+ public ClientPreparedStatement42
(
- Agent agent, Connection connection, String sql,
+ Agent agent, ClientConnection connection, String sql,
Section section,ClientPooledConnection cpc
) throws SqlException
{
@@ -50,9 +50,9 @@ public class PreparedStatement42 extends
* this is used to raise the Statement Events when the prepared
* statement is closed
*/
- public PreparedStatement42
+ public ClientPreparedStatement42
(
- Agent agent, Connection connection,String sql,
+ Agent agent, ClientConnection connection,String sql,
int type, int concurrency, int holdability, int autoGeneratedKeys,
String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc
) throws SqlException
@@ -62,7 +62,7 @@ public class PreparedStatement42 extends
}
public void setObject
- ( int parameterIndex, java.lang.Object x, SQLType targetSqlType )
+ ( int parameterIndex, Object x, SQLType targetSqlType )
throws SQLException
{
synchronized (connection_)
@@ -82,7 +82,7 @@ public class PreparedStatement42 extends
public void setObject
(
- int parameterIndex, java.lang.Object x,
+ int parameterIndex, Object x,
SQLType targetSqlType, int scaleOrLength
) throws SQLException
{