String sql = "update t_pmeta_total set pid=?,mpid=? where id='"+productgx.getId()+"'";
jt.update(sql, new PreparedStatementSetter() {
public void setValues(PreparedStatement ps) throws SQLException {
ps.setInt(1, productgx.getPid());
ps.setString(2, productgx.getMpid().trim());
} });------------------------------------------------------------------
mysql : 数据(看看插入的数据,中间有空格):1, 2, 3, 4, 5 我已经加了trim了.怎么插入进去的数据还是有空格?
jt.update(sql, new PreparedStatementSetter() {
public void setValues(PreparedStatement ps) throws SQLException {
ps.setInt(1, productgx.getPid());
ps.setString(2, productgx.getMpid().trim());
} });------------------------------------------------------------------
mysql : 数据(看看插入的数据,中间有空格):1, 2, 3, 4, 5 我已经加了trim了.怎么插入进去的数据还是有空格?
在添加数据的时候,会把verchar,nvarchar类型的字段用空格填满。。
如果你用的是Statement应该不会有这样的问题。
取的时候trim()一下就好了。。