JavaWeb项目中写的一条插入语句,大概是这样
customerInfo对象中的值全有,不存在为空。
下面是添加方法
public boolean customerInfoAdd(SendCard customerInfo){
try {
sqlSession.insert("insertSendCard", customerInfo);
} catch (Exception e) {
log.error("添加出错:insertSendCard");
e.printStackTrace();
return false;
}
return true;
}
<insert id="insertSendCard" parameterType="com.****.****.****.****">
<![CDATA[
insert into T_SENDCARD(
sendcardid,
termid,
idno,
name,
telphone,
address,
cardno,
issuedate,
operator,
sex,
nationality,
birthday,
cardtype,
organs
)
values
(
#{sendcardid},
#{termno},
#{idcard_no},
#{cus_name},
#{phone},
#{home_address},
#{bankcardno},
#{status_datetime},
#{bankuserid},
#{sex},
#{nation},
#{birthday},
#{cardtype},
#{fzjg}
)
]]>
</insert>
插入数据失败。
[0410 11:07:27 424 INFO ] [http-bio-8080-exec-7] factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
[0410 11:07:27 451 INFO ] [http-bio-8080-exec-7] jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
[0410 11:07:27 456 ERROR] [http-bio-8080-exec-7] TradeLogDaoImpl - 添加出错:insertSendCard
添加回答
举报
0/150
提交
取消