C# 中调用 mysql 存储过程并传递参数和获取返回值
CallableStatement PreparedFunc = MyConnect.prepareCall("{ ? = call isodd( ? ) }");
PreparedFunc.registerOutParameter(1, Types.INTEGER);
PreparedFunc.setInt(1, aNumber);
PreparedFunc.execute();
if (PreparedFunc.getInt(1) == 1)
System.out.println(aNumber + " is odd");
else
System.out.println(aNumber + " is even");