//?代表一个参数,多个参数用逗号隔开
CallableStatement cs = connect.prepareCall("{?=call 存储过程名称或函数名(?)}");
cs.registerOutParameter(1, Types.VARCHAR);//按参数顺序设置参数类型
cs.setString(2,"参数值");//参数赋值
cs.execute();
String result = cs.getString(1);//返回值
cs.close();
1 CallableStatement cs = connect.prepareCall("{?=call f_Leave(?)}"); 2 cs.registerOutParameter(1, Types.VARCHAR); 3 cs.setString(2, "参数"); 4 cs.execute(); 5 String result = cs.getString(1);//返回结果 6 cs.close();