PreparedStatements { public static String buildStoredRoutineCallText( String name, int numberOfParams, boolean hasReturnValueParam) { int numArgs = numberOfParams - (hasReturnValueParam ? 1 : 0); String resultAssignment = hasReturnValueParam ? "? = " : ""; String voidInvocation = name + "(" + buildParamList(numArgs) + ")"; return "{ " + resultAssignment + "call " + voidInvocation + " }"; }  static String buildStoredRoutineCallText(
            String name, int numberOfParams, boolean hasReturnValueParam);  }
@Test public void functionWithoutParameters() { assertEquals("{ ? = call func() }", buildStoredRoutineCallText("func", 1, true)); }
@Test public void functionWithParameters() { assertEquals("{ ? = call func(?, ?) }", buildStoredRoutineCallText("func", 3, true)); }
@Test public void procedureWithoutParameters() { assertEquals("{ call storedProc() }", buildStoredRoutineCallText("storedProc", 0, false)); }
@Test public void procedureWithParameters() { assertEquals("{ call storedProc(?, ?) }", buildStoredRoutineCallText("storedProc", 2, false)); }