请问如何在JAVA类中调用一个Oracle的自定义函数? 20
2017-08-23
展开全部
请问如何在JAVA类中调用一个Oracle的自定义函数?
cs = conn.prepareCall("{ ?=call goode(?,?)}");
// Register the type of the return value
cs.registerOutParameter(1, Types.NUMERIC );
// Set the value for the IN parameter
cs.setString(2,"lz");
cs.setString(3,"lz");
// Execute and retrieve the returned value
cs.execute();
int retValue = cs.getInt(1);
cs = conn.prepareCall("{ ?=call goode(?,?)}");
// Register the type of the return value
cs.registerOutParameter(1, Types.NUMERIC );
// Set the value for the IN parameter
cs.setString(2,"lz");
cs.setString(3,"lz");
// Execute and retrieve the returned value
cs.execute();
int retValue = cs.getInt(1);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询