JDBC???д洢????????
???????????? ???????[ 2012/11/7 10:11:41 ] ????????
??????Java??????????????????????????洢???????????????洢???????????????????????????????????????
?????????????????????????????????????????洢????????????洢????????????????????????????????
????????????????????????????????????????洢?????????????????趨?磺
?????????????????????????в??????????
?????????????????
??????????????????????????????????????????洢??????????????洢????????????????????????е???????????磺
??????????Щ??????????????????????????????????????????????????????????????洢???????????
???????棬???????γ?????????????????????????Ч????
?????÷?????????????????????????洢?????????????洢?????????????????????????Ч????
publicvoid getProcedureOut(){
con = DBCManager.getConnect();//??????????
try {
//??????????con??prepareCall()??????? CallableStatement???? cs
CallableStatement cs = con.prepareCall("{callmeOut(???????)}");
//?????????θ??
cs.setInt(1?? 1);
//????????????????????
cs.registerOutParameter(2?? Types.VARCHAR);
cs.registerOutParameter(3?? Types.INTEGER);
//??????
cs.execute();
//?????ε???????
System.out.print("name:"+cs.getString(2)+" age:"+cs.getInt(3));
} catch (SQLException e) {
// TODO Auto-generatedcatch block
e.printStackTrace();
}
DBCManager.release(rs?? ps?? con);
}
?????÷?????????????????????????洢?????????????洢?????????????????????е????????????????
publicvoid getProcedureIn(){
con = DBCManager.getConnect();//??????????
try {
//??????????con??prepareCall()??????? CallableStatement???? cs
CallableStatement cs = con.prepareCall("{call me(???????)}");
//?????????θ??
cs.setInt(1?? 7);
cs.setString(2?? "lang");
cs.setInt(3??30);
//???÷?????
boolean flag;
//??????
flag =cs.execute();
if(!flag){
System.out.print("????????");
}
} catch (SQLException e) {
// TODO Auto-generatedcatch block
e.printStackTrace();
}
DBCManager.release(rs?? ps?? con);
}
????????洢?????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11