Skip to content

Commit

Permalink
fix: Unable to register out parameter Issue #1646 (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
davecramer committed Dec 13, 2019
1 parent be5c9f4 commit ea2ca87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -183,7 +183,7 @@ public void closeImpl() throws SQLException {
public void setNull(int parameterIndex, int sqlType) throws SQLException {
checkClosed();

if (parameterIndex < 1 || parameterIndex > preparedParameters.getInParameterCount()) {
if (parameterIndex < 1 || parameterIndex > preparedParameters.getParameterCount()) {
throw new PSQLException(
GT.tr("The column index is out of range: {0}, number of columns: {1}.",
parameterIndex, preparedParameters.getInParameterCount()),
Expand Down
Expand Up @@ -88,4 +88,18 @@ public void testGetResultSetWithoutArgUnsupportedConversion() throws SQLExceptio
con.setAutoCommit(true);
}
}

@Test
public void testRegisterOutParameter() throws SQLException {

CallableStatement cs = null;

cs = con.prepareCall("{ ? = call xxxx.yyyy (?,?,?,?)}");
cs.registerOutParameter(1, Types.REF_CURSOR);

cs.setLong(2, 1000L);
cs.setLong(3, 500);
cs.setLong(4, 3000);
cs.setNull(5, Types.NUMERIC);
}
}

0 comments on commit ea2ca87

Please sign in to comment.