81,094
社区成员
发帖
与我相关
我的任务
分享
public int getId(){
int id = 0;
Connection conn = null;
Statement stmt = null;
try {
conn = this.db.getConnection();
stmt = conn.createStatement();
String sql = "{call dbo.insert_employee_1(?,?,?,?)}";
CallableStatement st = conn.prepareCall(sql);
st.setString(1,"13811217419");
st.setString(2,"fdasfdsa");
st.setString(3,"fdasfdsafads");
st.registerOutParameter(4, Types.INTEGER);
st.execute();
id = st.getInt(4);
st.close();
} catch (Exception e) {
logger.debug(e.toString());
} finally {
try {
if(conn!=null)
conn.close();
} catch (SQLException e) {
logger.debug("getContent "+e.toString());
}
}
return id;
}