|
@@ -156,6 +156,8 @@ public boolean executeWithFlags(int flags) throws SQLException { |
|
|
} |
|
|
|
|
|
/** |
|
|
* {@inheritDoc} |
|
|
* |
|
|
* <p>Before executing a stored procedure call you must explicitly call registerOutParameter to |
|
|
* register the java.sql.Type of each out parameter.</p> |
|
|
* |
|
@@ -169,7 +171,8 @@ public boolean executeWithFlags(int flags) throws SQLException { |
|
|
* Decimal use the version of registerOutParameter that accepts a scale value |
|
|
* @throws SQLException if a database-access error occurs. |
|
|
*/ |
|
|
public void registerOutParameter(int parameterIndex, int sqlType, boolean setPreparedParameters) |
|
|
@Override |
|
|
public void registerOutParameter(int parameterIndex, int sqlType) |
|
|
throws SQLException { |
|
|
checkClosed(); |
|
|
switch (sqlType) { |
|
@@ -191,6 +194,9 @@ public void registerOutParameter(int parameterIndex, int sqlType, boolean setPre |
|
|
case Types.LONGVARBINARY: |
|
|
sqlType = Types.BINARY; |
|
|
break; |
|
|
case Types.BOOLEAN: |
|
|
sqlType = Types.BIT; |
|
|
break; |
|
|
default: |
|
|
break; |
|
|
} |
|
@@ -202,9 +208,7 @@ public void registerOutParameter(int parameterIndex, int sqlType, boolean setPre |
|
|
} |
|
|
checkIndex(parameterIndex, false); |
|
|
|
|
|
if (setPreparedParameters) { |
|
|
preparedParameters.registerOutParameter(parameterIndex, sqlType); |
|
|
} |
|
|
preparedParameters.registerOutParameter(parameterIndex, sqlType); |
|
|
// functionReturnType contains the user supplied value to check |
|
|
// testReturn contains a modified version to make it easier to |
|
|
// check the getXXX methods.. |
|
@@ -220,24 +224,6 @@ public void registerOutParameter(int parameterIndex, int sqlType, boolean setPre |
|
|
returnTypeSet = true; |
|
|
} |
|
|
|
|
|
/** |
|
|
* <p>You must also specify the scale for numeric/decimal types.</p> |
|
|
* |
|
|
* <p>Note: When reading the value of an out parameter, you must use the getXXX method whose Java |
|
|
* type XXX corresponds to the parameter's registered SQL type.</p> |
|
|
* |
|
|
* @param parameterIndex the first parameter is 1, the second is 2,... |
|
|
* @param sqlType use either java.sql.Type.NUMERIC or java.sql.Type.DECIMAL |
|
|
* @param scale a value greater than or equal to zero representing the desired number of digits to |
|
|
* the right of the decimal point |
|
|
* @param setPreparedParameters set prepared parameters |
|
|
* @throws SQLException if a database-access error occurs. |
|
|
*/ |
|
|
public void registerOutParameter(int parameterIndex, int sqlType, int scale, |
|
|
boolean setPreparedParameters) throws SQLException { |
|
|
registerOutParameter(parameterIndex, sqlType, setPreparedParameters); // ignore for now.. |
|
|
} |
|
|
|
|
|
public boolean wasNull() throws SQLException { |
|
|
if (lastIndex == 0) { |
|
|
throw new PSQLException(GT.tr("wasNull cannot be call before fetching a result."), |
|
@@ -917,19 +903,6 @@ public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLExce |
|
|
throw Driver.notImplemented(this.getClass(), "getURL(String)"); |
|
|
} |
|
|
|
|
|
public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException { |
|
|
// if this isn't 8.1 or we are using protocol version 2 then we don't |
|
|
// register the parameter |
|
|
switch (sqlType) { |
|
|
case Types.BOOLEAN: |
|
|
sqlType = Types.BIT; |
|
|
break; |
|
|
default: |
|
|
|
|
|
} |
|
|
registerOutParameter(parameterIndex, sqlType, !adjustIndex); |
|
|
} |
|
|
|
|
|
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException { |
|
|
// ignore scale for now |
|
|
registerOutParameter(parameterIndex, sqlType); |
|
|