具体现象是什么?是不是忘记commit而又没有设置autocommit阿?

解决方案 »

  1.   

    具体代码如下:
    updateStatement = "update "+ tableName
                      + " set " + array[1] + " ='" + name +"'"
                      + " where " + array[0] + " = " + id;
    Connection c = getConnection();
    c.setAutoCommit(false);
    PreparedStatement ps = c.prepareStatement(updateStatement);
    ps.executeUpdate();
    ps.close();
    c.commit();
      

  2.   

    ...
    c.setAutoCommit(false);
    updateStatement= new String(updateStatement.getBytes("GB2312"),"iso8859-1");
    PreparedStatement ps = c.prepareStatement(updateStatement);
    ps.executeUpdate();
    ...
      

  3.   

    编译时候用-encoding gb2312参数
      

  4.   

    谢谢各位的帮助,其实不需要用new String(updateStatement.getBytes("GB2312"),"iso8859-1");这样的转换,
    如果是参数,使用pm.set***();就可以