第5讲 --删除指定id的单个对象
程序员文章站
2022-01-20 10:05:23
...
步骤:
1.增加 Student.xml中 对删除单个对象的支持 ,注意标签是 delete
<delete id="deleteStudentById" parameterClass="int">
delete from student where sid=#sid#
</delete>
2.在实现类中
public void deleteStudentById(int sid) {
try
{
sqlMapClient.delete("deleteStudentById",sid);
}
catch (SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}