具体现象是什么?是不是忘记commit而又没有设置autocommit阿?
解决方案 »
- 初学s2sh,提交action报错Error Creating SessionFactory
- select onclick 事件
- 急求:Hibernate 一对一更新时为什么出现insert
- 现有一JAVA高级群,欢迎各位高手来技术交流(新人勿入)
- oracle 如何选出很多个字段,并且按照其中一个字段不重复?
- 使用struts2 对于hibernate spring jdk版本有没有要求?
- 关于AJAX的表现技术的疑惑
- 用JavaBean无法实现文件操作,不知是何原因,急!
- struts的控制器问题,比较收悉struts进来看看
- 在jboss下servlet访问EJB的问题!紧急求救!
- 本来要去看《英雄》的
- 用java application 读取 jsp输出的xml文件的问题
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();
c.setAutoCommit(false);
updateStatement= new String(updateStatement.getBytes("GB2312"),"iso8859-1");
PreparedStatement ps = c.prepareStatement(updateStatement);
ps.executeUpdate();
...
如果是参数,使用pm.set***();就可以