Skip to content

Commit

Permalink
(#29) changed named parameter expression to math sql standard
Browse files Browse the repository at this point in the history
  • Loading branch information
svettwer committed Sep 5, 2019
1 parent b615aef commit 1eae951
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,13 @@ public void testIndexedParametersAreOrderedCorrectly() throws SQLException {
public void testNamedParametersAreOrderedCorrectly() {

//GIVEN
final String parameter1 = "z-param";
final String parameter2 = "a-param";
final String parameter1 = "zParam";
final String parameter2 = "aParam";
final JdbcCallableStatement callableStatement =
generateCallableStatementWithParameter(parameter1, parameter2);
callableStatement.registerOutParameter(parameter1, Types.VARCHAR);
callableStatement.registerOutParameter(parameter2, Types.VARCHAR);
final String expectedStatement = "CALL myFunction(z-param=>?,a-param=>?) - (foo,bar)";
final String expectedStatement = "CALL myFunction(:zParam,:aParam) - (foo,bar)";

//WHEN
callableStatement.setString(parameter1,"foo");
Expand All @@ -999,7 +999,7 @@ public void testParametersMixedParametersAreOrderedCorrectly() throws SQLExcepti
callableStatement.registerOutParameter(2, Types.VARCHAR);
callableStatement.registerOutParameter(parameterName, Types.VARCHAR);

final String expectedStatement = "CALL myFunction(foo=>?,?) - (foobar, bar)";
final String expectedStatement = "CALL myFunction(:foo,?) - (foobar, bar)";

//WHEN
callableStatement.setParameter(2, "bar");
Expand Down Expand Up @@ -1056,12 +1056,12 @@ private JdbcCallableStatement generateCallableStatement() {
}

private JdbcCallableStatement generateCallableStatementWithParameter(final String parameterName) {
final String statement = "CALL myFunction("+parameterName+"=>?,?)";
final String statement = "CALL myFunction(:"+parameterName+",?)";
return new JdbcCallableStatement(httpClient,statement, serverUrl, jdbcConnection, lobUtils);
}

private JdbcCallableStatement generateCallableStatementWithParameter(final String parameterName, final String parameterNameTwo) {
final String statement = "CALL myFunction("+parameterName+"=>?,"+parameterNameTwo+"=>?)";
final String statement = "CALL myFunction(:"+parameterName+",:"+parameterNameTwo+")";
return new JdbcCallableStatement(httpClient,statement, serverUrl, jdbcConnection, lobUtils);
}
}

0 comments on commit 1eae951

Please sign in to comment.