为什么数据插不进库中啊?SuspiciousTradeDaoImpl中的SuspiciousTradeEO有值的,代码如下
Junit 测试类
package com.fndsoft.ies4.aml.trade.dao.impl;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;import com.fndsoft.ies4.aml.trade.dao.SuspiciousTradeDao;
import com.fndsoft.ies4.aml.trade.domain.entity.SuspiciousTradeEO;
import com.fndsoft.ies4.core.spring.ServiceLocator;public class SuspiciousTradeSave {
private SuspiciousTradeEO sTrade;
private SuspiciousTradeDao tradeDao; public SuspiciousTradeEO getsTrade() {
return sTrade;
} public void setsTrade(SuspiciousTradeEO sTrade) {
this.sTrade = sTrade;
} @Before 
public void initConfig() {
// String config = "WebContent/WEB-INF/conf/application-context.xml";
// ApplicationContext ctx = new ClassPathXmlApplicationContext(config);  
Resource rs = new FileSystemResource("D:\\workspace\\IES4AML\\WebContent\\WEB-INF\\conf\\application-context.xml");
    BeanFactory factory = new XmlBeanFactory(rs);
tradeDao = (SuspiciousTradeDao) factory.getBean("suspiciousTradeDao");
}

public Connection getConnectionByJDBC() {
Connection conn = null;
try { // 装载驱动类
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
System.out.println("装载驱动异常!");
e.printStackTrace();
}
try { // 建立JDBC连接
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@192.168.0.102:1521/IES4AUTO", "fxq",
"fxq");
} catch (SQLException e) {
System.out.println("链接数据库异常!");
e.printStackTrace();
}
return conn;
} @Test
public void testOneSave() {
Connection conn = getConnectionByJDBC();
initConfig();
if (tradeDao == null) {

System.out.println(tradeDao);
}
sTrade = new SuspiciousTradeEO();
Statement stmt = null;
try {
String sql = "select * from aml_suspicioustrade where tradeNo = 'S00001801'";
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
String agentName = rs.getString("agentName");
System.out.println(agentName);
sTrade.setTradeNo(null);
sTrade.setAgentCertDesc(rs.getString("agentCertDesc"));
sTrade.setAgentCertNo(rs.getString("agentCertNo"));
sTrade.setAgentCertType(rs.getString("agentCertType"));
sTrade.setAgentCertDesc(rs.getString("agentCertDesc"));
sTrade.setAgentName(rs.getString("agentName"));
sTrade.setAlarmLevel(rs.getString("alarmLevel"));
sTrade.setAmount(rs.getDouble("amount"));
sTrade.setBehaviour(rs.getString("behaviour"));
sTrade.setCharacterCode(rs.getString("characterCode"));
sTrade.setCreationTime(rs.getDate("creationTime"));
sTrade.setCurrency(rs.getString("currency"));
sTrade.setCustomerNo(rs.getString("customerNo"));
sTrade.setDataSource(rs.getString("dataSource"));
sTrade.setDegree(rs.getString("degree"));
sTrade.setDistrictCode(rs.getString("districtCode"));
sTrade.setEtlDate(rs.getDate("etlDate"));
sTrade.setFlowMethod(rs.getString("flowMethod"));
sTrade.setFundDirection(rs.getString("fundDirection"));
sTrade.setGroupId(rs.getInt("groupId"));
sTrade.setInputDate(rs.getDate("inputDate"));
sTrade.setLastModified(new Date());
sTrade.setLocationDistrict(rs.getString("locationDistrict"));
sTrade.setMeasures(rs.getString("measures"));
sTrade.setMeasuresDesc(rs.getString("measuresDesc"));
sTrade.setOpeningBank(rs.getString("openingBank"));
sTrade.setOrgAddress(rs.getString("orgAddress"));
sTrade.setOrgCode(rs.getString("orgCode"));
sTrade.setOrgCodeType(rs.getString("orgCodeType"));
sTrade.setOrgContact(rs.getString("orgContact"));
sTrade.setOrgName(rs.getString("orgName"));
sTrade.setOrgOfStaff(rs.getString("orgOfStaff"));
sTrade.setOrgOfTrade(rs.getString("orgOfTrade"));
sTrade.setOrgOtherInfo(rs.getString("orgOtherInfo"));
sTrade.setOrgTelephone(rs.getString("orgTelephone"));
sTrade.setRes(rs.getString("res"));
sTrade.setStatus(rs.getString("status"));
sTrade.setTradeDate(rs.getDate("tradeDate"));
sTrade.setTradeLocation(rs.getString("tradeLocation"));
sTrade.setTradeType(rs.getString("tradeType"));
sTrade.setTransferAccount(rs.getString("transferAccount"));
sTrade.setMessageType(rs.getString("messageType"));
System.out.println(sTrade.getAgentName());
System.out.println(sTrade.getCreationTime());
if (sTrade != null && tradeDao != null) {
tradeDao.save(sTrade);
System.out.println("///////////");
} else {
System.out.println("****");
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (conn != null || stmt != null)
conn.close();
    stmt.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
} }
} SuspiciousTradeDaoImpl实现类
package com.fndsoft.ies4.aml.trade.dao.impl;import java.util.ArrayList;
import java.util.Date;
import java.util.List;import org.apache.commons.lang.StringUtils;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;import com.fndsoft.ies4.aml.common.constant.BusinessType;
import com.fndsoft.ies4.aml.common.constant.DataSource;
import com.fndsoft.ies4.aml.common.constant.MessageType;
import com.fndsoft.ies4.aml.common.constant.QueryType;
import com.fndsoft.ies4.aml.common.constant.TradeStatus;
import com.fndsoft.ies4.aml.trade.dao.SuspiciousTradeDao;
import com.fndsoft.ies4.aml.trade.domain.entity.SuspiciousTradeEO;
import com.fndsoft.ies4.aml.trade.vo.SuspiciousTradeBriefVo;
import com.fndsoft.ies4.aml.trade.vo.TradeQueryVo;
import com.fndsoft.ies4.aml.utils.OrganizationUtils;public class SuspiciousTradeDaoImpl implements SuspiciousTradeDao {
private SimpleJdbcTemplate jdbc;
private DataFieldMaxValueIncrementer incrementer; public void setJdbc(SimpleJdbcTemplate jdbc) {
this.jdbc = jdbc;
} public void setIncrementer(DataFieldMaxValueIncrementer incrementer) {
this.incrementer = incrementer;
} public void save(SuspiciousTradeEO trade) {
System.out.println("222222222222222222");
final String sql = "insert into aml_suspicioustrade(tradeNo,"
+ "dataSource,orgOfTrade,etlDate,inputDate,"
+ "inputStaff,orgOfStaff,status,messageType,orgName,"
+ "districtCode,orgCodeType,orgCode,orgContact,orgTelephone,"
+ "orgAddress,orgOtherInfo,tradeLocation,locationDistrict,"
+ "characterCode,degree,measures,behaviour,customerNo,tradeDate,"
+ "tradeType,currency,amount,fundDirection,flowMethod,"
+ "openingBank,transferAccount,agentName,agentCertType,agentCertDesc,"
+ "agentCertNo,alarmLevel,res,groupId,"
+ "creationTime,lastModified,measuresDesc)"
+ "values(:tradeNo,:dataSource,"
+ ":orgOfTrade,:etlDate,:inputDate,:inputStaff,:orgOfStaff,:status,"
+ ":messageType,:orgName,:districtCode,:orgCodeType,:orgCode,"
+ ":orgContact,:orgTelephone,:orgAddress,:orgOtherInfo,"
+ ":tradeLocation,:locationDistrict,:characterCode,:degree,:measures,"
+ ":behaviour,:customerNo,:tradeDate,:tradeType,:currency,:amount,"
+ ":fundDirection,:flowMethod,:openingBank,:transferAccount,"
+ ":agentName,:agentCertType,:agentCertDesc,:agentCertNo,"
+ ":alarmLevel,:res,:groupId,"
+ ":creationTime,:lastModified,:measuresDesc)";
System.out.println(sql);
if (StringUtils.isEmpty(trade.getTradeNo())) {
System.out.println("33333333333333333333333");
trade.setTradeNo(String.format("S%08d", incrementer.nextIntValue()));
System.out.println("44444444444444444444444");
trade.setCreationTime(new Date());
}
trade.setLastModified(new Date());
        System.out.println("55555555555555555555555");
jdbc.update(sql, new BeanPropertySqlParameterSource(trade));
System.out.println("666666666666");
}}