class 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 + " }";
    }

}