新增和修改
谁写了新增 学习一下
谁写了新增 学习一下
2017-08-02
<insert id="insertOneMessage" parameterType="com.him.entity.Message" >
INSERT INTO message(command,description,content) VALUES(#{command},#{description},#{content})
</insert>
SqlSession sqlSession = null;
try {
sqlSession = DBAccess.getSqlSession();
sqlSession.insert("Message.insertOneMessage", message);
sqlSession.commit();
} catch (IOException e) {
e.printStackTrace();
return null;
}finally {
if(sqlSession != null) {
sqlSession.close();
}
}
举报