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 ka...@apache.org on 2006/10/13 07:55:20 UTC
svn commit: r463565 - in /db/derby/code/trunk/java:
build/org/apache/derbyBuild/ client/org/apache/derby/client/am/
engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/
Author: kahatlen
Date: Thu Oct 12 22:55:18 2006
New Revision: 463565
URL: http://svn.apache.org/viewvc?view=rev&rev=463565
Log:
DERBY-1956: Remove stale code from the statement classes in the client driver
The patch removes escapedProcedureCallWithResult_ and all code that is
only executed when the flag is true. It also removes a couple of
methods that became no-ops, and SQLStates and messages that are never
used.
Modified:
db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java
db/derby/code/trunk/java/client/org/apache/derby/client/am/ParameterMetaData.java
db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java
db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java
db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_pt_BR.properties
db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java Thu Oct 12 22:55:18 2006
@@ -69,7 +69,6 @@
clientMessageIds.add(SQLState.LANG_INVALID_COLUMN_POSITION);
clientMessageIds.add(SQLState.INVALID_COLUMN_NAME);
clientMessageIds.add(SQLState.HOLDABLE_RESULT_SET_NOT_AVAILABLE);
- clientMessageIds.add(SQLState.LANG_RETURN_OUTPUT_PARAM_CANNOT_BE_SET);
clientMessageIds.add(SQLState.LANG_NULL_INTO_NON_NULL);
clientMessageIds.add(SQLState.JDBC_METHOD_NOT_IMPLEMENTED);
clientMessageIds.add(SQLState.JDBC_METHOD_NOT_SUPPORTED_BY_SERVER);
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement.java Thu Oct 12 22:55:18 2006
@@ -162,7 +162,6 @@
}
private int guessScaleForDecimalOrNumeric(int parameterIndex) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
// Types.DECIMAL with no supplied scale will use the scale supplied by the setter method if input BigDecimal is not null
if (parameterMetaData_.types_[parameterIndex - 1] == Types.DECIMAL &&
parameters_[parameterIndex - 1] != null) {
@@ -189,11 +188,6 @@
}
private void registerOutParameterX(int parameterIndex, int jdbcType, int scale) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex, jdbcType);
- // if the parameter is the return clause of the call statement
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- return;
- }
super.checkForValidParameterIndex(parameterIndex);
checkForValidScale(scale);
outputRegistered_ = true; // this variable is only used by Batch
@@ -245,16 +239,7 @@
agent_.logWriter_.traceEntry(this, "getBoolean", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
boolean result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = agent_.crossConverters_.getBooleanFromInt(returnValueFromProcedure_);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getBoolean", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? false : singletonRowData_.getBoolean(parameterIndex);
@@ -278,16 +263,7 @@
agent_.logWriter_.traceEntry(this, "getByte", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
byte result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = agent_.crossConverters_.getByteFromInt(returnValueFromProcedure_);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getByte", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? 0 : singletonRowData_.getByte(parameterIndex);
@@ -311,16 +287,7 @@
agent_.logWriter_.traceEntry(this, "getShort", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
short result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = agent_.crossConverters_.getShortFromInt(returnValueFromProcedure_);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getShort", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? 0 : singletonRowData_.getShort(parameterIndex);
@@ -359,11 +326,6 @@
// also used by SQLCA
int getIntX(int parameterIndex) throws SqlException {
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- this.wasNull_ = this.WAS_NOT_NULL;
- return returnValueFromProcedure_;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
return wasNullX() ? 0 : singletonRowData_.getInt(parameterIndex);
@@ -377,16 +339,7 @@
agent_.logWriter_.traceEntry(this, "getLong", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
long result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = (long) returnValueFromProcedure_;
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getLong", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? 0 : singletonRowData_.getLong(parameterIndex);
@@ -410,16 +363,7 @@
agent_.logWriter_.traceEntry(this, "getFloat", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
float result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = (float) returnValueFromProcedure_;
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getFloat", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? 0 : singletonRowData_.getFloat(parameterIndex);
@@ -443,16 +387,7 @@
agent_.logWriter_.traceEntry(this, "getDouble", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
double result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = (double) returnValueFromProcedure_;
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getDouble", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? 0 : singletonRowData_.getDouble(parameterIndex);
@@ -477,16 +412,7 @@
}
super.checkForClosedStatement();
checkForValidScale(scale);
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
java.math.BigDecimal result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = java.math.BigDecimal.valueOf(returnValueFromProcedure_).setScale(scale);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceDeprecatedExit(this, "getBigDecimal", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? null : singletonRowData_.getBigDecimal(parameterIndex);
@@ -513,16 +439,7 @@
agent_.logWriter_.traceEntry(this, "getBigDecimal", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
java.math.BigDecimal result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = java.math.BigDecimal.valueOf(returnValueFromProcedure_);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getBigDecimal", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? null : singletonRowData_.getBigDecimal(parameterIndex);
@@ -546,11 +463,6 @@
agent_.logWriter_.traceEntry(this, "getDate", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Date result = wasNullX() ? null : singletonRowData_.getDate(parameterIndex);
@@ -604,11 +516,6 @@
agent_.logWriter_.traceEntry(this, "getTime", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Time result = wasNullX() ? null : singletonRowData_.getTime(parameterIndex);
@@ -661,11 +568,6 @@
agent_.logWriter_.traceEntry(this, "getTimestamp", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Timestamp result = wasNullX() ? null : singletonRowData_.getTimestamp(parameterIndex);
@@ -735,11 +637,6 @@
// also used by SQLCA
String getStringX(int parameterIndex) throws SqlException {
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- this.wasNull_ = this.WAS_NOT_NULL;
- return Integer.toString(returnValueFromProcedure_);
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
return wasNullX() ? null : singletonRowData_.getString(parameterIndex);
@@ -753,11 +650,6 @@
agent_.logWriter_.traceEntry(this, "getBytes", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
byte[] result = wasNullX() ? null : singletonRowData_.getBytes(parameterIndex);
@@ -781,11 +673,6 @@
agent_.logWriter_.traceEntry(this, "getBlob", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Blob result = wasNullX() ? null : singletonRowData_.getBlob(parameterIndex);
@@ -806,11 +693,6 @@
{
synchronized (connection_) {
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Clob result = wasNullX() ? null : singletonRowData_.getClob(parameterIndex);
@@ -834,11 +716,6 @@
agent_.logWriter_.traceEntry(this, "getArray", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Array result = wasNullX() ? null : singletonRowData_.getArray(parameterIndex);
@@ -866,11 +743,6 @@
agent_.logWriter_.traceEntry(this, "getRef", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.INVALID_PARAM_USE_GETINT));
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
java.sql.Ref result = wasNullX() ? null : singletonRowData_.getRef(parameterIndex);
@@ -898,16 +770,7 @@
agent_.logWriter_.traceEntry(this, "getObject", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
Object result;
- if (parameterIndex == 0 && escapedProcedureCallWithResult_) {
- result = new Integer(returnValueFromProcedure_);
- this.wasNull_ = this.WAS_NOT_NULL;
- if (agent_.loggingEnabled()) {
- agent_.logWriter_.traceExit(this, "getObject", result);
- }
- return result;
- }
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
result = wasNullX() ? null : singletonRowData_.getObject(parameterIndex);
@@ -931,7 +794,6 @@
agent_.logWriter_.traceEntry(this, "getObject", parameterIndex, map);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
Object result;
checkGetterPreconditions(parameterIndex);
if (true) {
@@ -1326,7 +1188,6 @@
agent_.logWriter_.traceEntry(this, "getCharacterStream", parameterIndex);
}
super.checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
checkGetterPreconditions(parameterIndex);
setWasNull(parameterIndex);
Reader reader = null;
@@ -1352,25 +1213,6 @@
*/
protected String getJdbcStatementInterfaceName() {
return "java.sql.CallableStatement";
- }
-
- private int checkForEscapedCallWithResult(int parameterIndex) throws SqlException {
- if (escapedProcedureCallWithResult_) {
- parameterIndex--;
- }
- return parameterIndex;
- }
-
- private int checkForEscapedCallWithResult(int parameterIndex, int jdbcType) throws SqlException {
- if (escapedProcedureCallWithResult_) {
- if (parameterIndex == 1 && jdbcType != java.sql.Types.INTEGER) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.RETURN_PARAM_MUST_BE_INT));
- } else {
- parameterIndex--;
- }
- }
- return parameterIndex;
}
private void checkGetterPreconditions(int parameterIndex) throws SqlException {
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ParameterMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ParameterMetaData.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ParameterMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ParameterMetaData.java Thu Oct 12 22:55:18 2006
@@ -33,59 +33,29 @@
public class ParameterMetaData implements java.sql.ParameterMetaData {
ColumnMetaData columnMetaData_;
- // This is false unless for parameterMetaData for a call statement with return clause
- boolean escapedProcedureCallWithResult_ = false;
-
public ParameterMetaData(ColumnMetaData columnMetaData) {
columnMetaData_ = columnMetaData;
}
public int getParameterCount() throws SQLException {
- if (escapedProcedureCallWithResult_) {
- return columnMetaData_.columns_++;
- }
return columnMetaData_.columns_;
}
public int getParameterType(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return java.sql.Types.INTEGER;
- }
- }
return columnMetaData_.getColumnType(param);
}
public String getParameterTypeName(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return "INTEGER";
- }
- }
return columnMetaData_.getColumnTypeName(param);
}
public String getParameterClassName(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return "java.lang.Integer";
- }
- }
return columnMetaData_.getColumnClassName(param);
}
public int getParameterMode(int param) throws SQLException {
try
{
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return java.sql.ParameterMetaData.parameterModeOut;
- }
- }
columnMetaData_.checkForValidColumnIndex(param);
if (columnMetaData_.sqlxParmmode_[param - 1] == java.sql.ParameterMetaData.parameterModeUnknown) {
return java.sql.ParameterMetaData.parameterModeUnknown;
@@ -104,42 +74,18 @@
}
public int isNullable(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return java.sql.ResultSetMetaData.columnNoNulls;
- }
- }
return columnMetaData_.isNullable(param);
}
public boolean isSigned(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return true;
- }
- }
return columnMetaData_.isSigned(param);
}
public int getPrecision(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return 10;
- }
- }
return columnMetaData_.getPrecision(param);
}
public int getScale(int param) throws SQLException {
- if (escapedProcedureCallWithResult_) {
- param--;
- if (param == 0) {
- return 0;
- }
- }
return columnMetaData_.getScale(param);
}
Modified: 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/PreparedStatement.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- 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/PreparedStatement.java Thu Oct 12 22:55:18 2006
@@ -414,7 +414,7 @@
checkForSupportedDataType(jdbcType);
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult(parameterIndex) ) ;
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.getPossibleTypesForNull( paramType ).checkType( jdbcType )){
@@ -436,7 +436,6 @@
// also used by DBMD methods
void setNullX(int parameterIndex, int jdbcType) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = jdbcType;
if (!parameterMetaData_.nullable_[parameterIndex - 1]) {
@@ -466,7 +465,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ) {
@@ -476,7 +475,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BIT;
setInput(parameterIndex, new Short((short) (x ? 1 : 0)));
}
@@ -496,7 +494,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
@@ -506,7 +504,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TINYINT;
setInput(parameterIndex, new Short(x));
}
@@ -526,7 +523,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
@@ -548,7 +545,6 @@
// also used by DBMD methods
void setShortX(int parameterIndex, short x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.SMALLINT;
setInput(parameterIndex, new Short(x));
@@ -563,7 +559,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
@@ -583,7 +579,6 @@
// also used by DBMD methods
void setIntX(int parameterIndex, int x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.INTEGER;
setInput(parameterIndex, new Integer(x));
}
@@ -598,7 +593,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
@@ -607,7 +602,6 @@
paramType);
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BIGINT;
setInput(parameterIndex, new Long(x));
}
@@ -627,7 +621,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
@@ -637,7 +631,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.REAL;
setInput(parameterIndex, new Float(x));
}
@@ -657,7 +650,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){
@@ -667,7 +660,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DOUBLE;
setInput(parameterIndex, new Double(x));
}
@@ -687,7 +679,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){
@@ -697,7 +689,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DECIMAL;
if (x == null) {
setNull(parameterIndex, java.sql.Types.DECIMAL);
@@ -722,7 +713,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_DATE.checkType(paramType) ){
@@ -733,7 +724,6 @@
}
checkForClosedStatement();
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.DATE;
if (x == null) {
setNull(parameterIndex, java.sql.Types.DATE);
@@ -791,7 +781,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIME.checkType( paramType ) ){
@@ -800,7 +790,6 @@
paramType );
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TIME;
if (x == null) {
setNull(parameterIndex, java.sql.Types.TIME);
@@ -859,7 +848,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIMESTAMP.checkType( paramType ) ) {
@@ -869,7 +858,6 @@
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.TIMESTAMP;
if (x == null) {
@@ -934,7 +922,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_STRING.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_ ,
@@ -953,7 +941,6 @@
// also used by DBMD methods
void setStringX(int parameterIndex, String x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.LONGVARCHAR;
if (x == null) {
setNullX(parameterIndex, java.sql.Types.LONGVARCHAR);
@@ -971,7 +958,7 @@
}
final int paramType =
- getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
+ getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BYTES.checkType( paramType ) ){
@@ -991,7 +978,6 @@
// also used by BLOB
public void setBytesX(int parameterIndex, byte[] x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.LONGVARBINARY;
if (x == null) {
setNullX(parameterIndex, java.sql.Types.LONGVARBINARY);
@@ -1054,7 +1040,6 @@
protected void setBinaryStreamX(int parameterIndex,
java.io.InputStream x,
int length) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BLOB;
if (x == null) {
setNullX(parameterIndex, java.sql.Types.BLOB);
@@ -1094,7 +1079,6 @@
checkTypeForSetAsciiStream(parameterIndex);
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
if (x == null) {
setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
@@ -1132,8 +1116,7 @@
private void checkTypeForSetAsciiStream(int parameterIndex)
throws SqlException, SQLException {
- int paramType = getColumnMetaDataX().getColumnType(
- checkForEscapedCallWithResult(parameterIndex));
+ int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
if ( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_ASCIISTREAM.checkType( paramType ) ) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
@@ -1146,8 +1129,7 @@
private void checkTypeForSetBinaryStream(int parameterIndex)
throws SqlException, SQLException {
- int paramType = getColumnMetaDataX().getColumnType(
- checkForEscapedCallWithResult(parameterIndex));
+ int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM.
checkType(paramType)) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
@@ -1158,8 +1140,7 @@
private void checkTypeForSetCharacterStream(int parameterIndex)
throws SqlException, SQLException {
- int paramType = getColumnMetaDataX().getColumnType(
- checkForEscapedCallWithResult(parameterIndex));
+ int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM.
checkType(paramType)) {
PossibleTypes.throw22005Exception(agent_.logWriter_,
@@ -1170,8 +1151,7 @@
private void checkTypeForSetBlob(int parameterIndex)
throws SqlException, SQLException {
- int paramType = getColumnMetaDataX().getColumnType(
- checkForEscapedCallWithResult(parameterIndex));
+ int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BLOB.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
@@ -1183,8 +1163,7 @@
private void checkTypeForSetClob(int parameterIndex)
throws SqlException, SQLException {
- int paramType = getColumnMetaDataX().getColumnType(
- checkForEscapedCallWithResult(parameterIndex));
+ int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CLOB.checkType( paramType ) ){
PossibleTypes.throw22005Exception(agent_.logWriter_,
@@ -1242,7 +1221,6 @@
}
try {
checkTypeForSetCharacterStream(parameterIndex);
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex -1] =
java.sql.Types.CLOB;
if (x == null) {
@@ -1278,7 +1256,6 @@
agent_.logWriter_.traceEntry(this, "setCharacterStream", parameterIndex, x, new Long(length));
}
checkTypeForSetCharacterStream(parameterIndex);
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
if (x == null) {
setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
@@ -1336,7 +1313,6 @@
// also used by Blob
public void setBlobX(int parameterIndex, java.sql.Blob x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.BLOB;
if (x == null) {
setNullX(parameterIndex, java.sql.Types.BLOB);
@@ -1364,7 +1340,6 @@
// also used by Clob
void setClobX(int parameterIndex, java.sql.Clob x) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
if (x == null) {
this.setNullX(parameterIndex, Types.CLOB);
@@ -1381,7 +1356,6 @@
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "setArray", parameterIndex, x);
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
}
@@ -1399,7 +1373,6 @@
if (agent_.loggingEnabled()) {
agent_.logWriter_.traceEntry(this, "setRef", parameterIndex, x);
}
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
}
@@ -1509,7 +1482,6 @@
Object x,
int targetJdbcType,
int scale) throws SqlException {
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
checkForValidScale(scale);
// JDBC 4.0 requires us to throw SQLFeatureNotSupportedException for
@@ -1779,9 +1751,6 @@
private ParameterMetaData getParameterMetaDataX() throws SqlException {
ParameterMetaData pm = ClientDriver.getFactory().newParameterMetaData
( getColumnMetaDataX() );
- if (escapedProcedureCallWithResult_) {
- pm.escapedProcedureCallWithResult_ = true;
- }
return pm;
}
@@ -2450,19 +2419,6 @@
}
}
-
- private int checkForEscapedCallWithResult(int parameterIndex) throws SqlException {
- if (escapedProcedureCallWithResult_) {
- if (parameterIndex == 1) {
- throw new SqlException(agent_.logWriter_,
- new ClientMessageId(SQLState.LANG_RETURN_OUTPUT_PARAM_CANNOT_BE_SET));
- } else {
- parameterIndex--;
- }
- }
- return parameterIndex;
- }
-
void checkForValidScale(int scale) throws SqlException {
if (scale < 0 || scale > 31) {
throw new SqlException(agent_.logWriter_,
@@ -2600,7 +2556,6 @@
}
try {
checkTypeForSetAsciiStream(parameterIndex);
- parameterIndex = checkForEscapedCallWithResult(parameterIndex);
parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB;
if (x == null) {
setNull(parameterIndex, java.sql.Types.LONGVARCHAR);
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java Thu Oct 12 22:55:18 2006
@@ -141,7 +141,6 @@
int timeout_ = 0; // for query timeout in seconds
int maxRows_ = 0;
int maxFieldSize_ = 0; // zero means that there is no limit to the size of a column.
- boolean escapedProcedureCallWithResult_ = false;
// When this is false we skip autocommit for this PreparedStatement.
// This is needed when the PreparedStatement object is used internally by
@@ -250,7 +249,6 @@
doWriteTimeout = false;
maxRows_ = 0;
maxFieldSize_ = 0;
- escapedProcedureCallWithResult_ = false;
isCatalogQuery_ = false;
isAutoCommittableStatement_ = true;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties Thu Oct 12 22:55:18 2006
@@ -1239,10 +1239,8 @@
XJ086.S=This method cannot be invoked while the cursor is not on the insert row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.
XJ088.S=Invalid operation: wasNull() called with no data retrieved.
-XJ089.S=Invalid method call: parameter 1 is an integer OUT parameter returned by the stored procedure, use getInt call.
XJ090.S=Invalid parameter: calendar is null.
XJ091.S=Invalid argument: parameter index {0} is not an OUT or INOUT parameter.
-XJ092.S=Parameter 1 is the return clause of the stored procedure call. It can only be registered as an integer type.
XJ093.S=Length of BLOB/CLOB, {0}, is too large. The length cannot exceed {1}.
XJ094.S=This object is already closed.
XJ095.S=An attempt to execute a privileged action failed.
Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_pt_BR.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_pt_BR.properties?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_pt_BR.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_pt_BR.properties Thu Oct 12 22:55:18 2006
@@ -1210,10 +1210,8 @@
XJ086.S=Este m\u00e9todo n\u00e3o pode ser chamado, a n\u00e3o ser que o cursor esteja posicionado na linha de inser\u00e7\u00e3o.
XJ088.S=Opera\u00e7\u00e3o inv\u00e1lida: foi chamado wasNull() sem nenhum dado buscado.
-XJ089.S=Chamada de m\u00e9todo inv\u00e1lida: o par\u00e2metro 1 \u00e9 o par\u00e2metro OUT retornado pelo procedimento armazenado, utilize a chamada ''getInt''.
XJ090.S=Par\u00e2metro inv\u00e1lido: o calend\u00e1rio \u00e9 nulo.
XJ091.S=Argumento inv\u00e1lido: o \u00edndice do par\u00e2metro {0} n\u00e3o \u00e9 um par\u00e2metro OUT ou INOUT.
-XJ092.S=O par\u00e2metro 1 \u00e9 a cl\u00e1usula ''return'' da chamada de procedimento armazenado. Somente pode ser registrado como do tipo inteiro.
XJ093.S=O comprimento do BLOB/CLOB, {0}, \u00e9 muito grande. O comprimento n\u00e3o pode exceder {1}.
XJ094.S=Este objeto j\u00e1 se encontra fechado.
XJ095.S=Falha na tentativa de executar uma a\u00e7\u00e3o privilegiada.
Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?view=diff&rev=463565&r1=463564&r2=463565
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java Thu Oct 12 22:55:18 2006
@@ -1445,10 +1445,8 @@
String WASNULL_INVALID = "XJ088.S";
- String INVALID_PARAM_USE_GETINT = "XJ089.S";
String CALENDAR_IS_NULL = "XJ090.S";
String PARAM_NOT_OUT_OR_INOUT = "XJ091.S";
- String RETURN_PARAM_MUST_BE_INT = "XJ092.S";
String BLOB_TOO_LARGE_FOR_CLIENT = "XJ093.S";
String OBJECT_ALREADY_CLOSED = "XJ094.S";
String ERROR_PRIVILEGED_ACTION = "XJ095.S";