Skip to content

Commit

Permalink
Additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyc committed Feb 8, 2024
1 parent 6aec311 commit c128ad0
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,6 @@ public void testRegisteringOutputByIndexandAcquiringOutputParamByName() throws S

@Test
public void testExecuteSystemStoredProcedureNamedParametersNoResultset() throws SQLException {
// Uppercase 'EXEC' command test
String call = "EXEC sp_getapplock @Resource=?, @LockTimeout='60', @LockMode='Exclusive', @LockOwner='Session'";

try (CallableStatement cstmt = connection.prepareCall(call)) {
Expand All @@ -1080,7 +1079,6 @@ public void testExecuteSystemStoredProcedureNamedParametersNoResultset() throws

@Test
public void testExecuteSystemStoredProcedureNamedParametersResultSet() throws SQLException {
// Lowercase 'exec' command test
String call = "exec sp_sproc_columns_100 ?, @ODBCVer=3, @fUsePattern=0";

try (CallableStatement cstmt = connection.prepareCall(call)) {
Expand All @@ -1094,6 +1092,20 @@ public void testExecuteSystemStoredProcedureNamedParametersResultSet() throws SQ
}
}

@Test
public void testExecuteSystemStoredProcedureNoNamedParametersResultSet() throws SQLException {
String call = "execute sp_sproc_columns_100 sp_getapplock, @ODBCVer=3, @fUsePattern=0";

try (CallableStatement cstmt = connection.prepareCall(call)) {

try (ResultSet rs = cstmt.executeQuery()) {
while (rs.next()) {
assertTrue("Failed -- ResultSet was not returned.", !rs.getString(4).isEmpty());
}
}
}
}

/**
* Cleanup after test
*
Expand Down

0 comments on commit c128ad0

Please sign in to comment.