首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

求教 java连接oracle 执行有关问题

2013-09-06 
求教 java连接oracle 执行问题sqlupdate pets set OWNER_IDnull where id?try {this.pstthis.con.p

求教 java连接oracle 执行问题

sql="update pets set OWNER_ID=null where id=?";
try {
this.pst=this.con.prepareStatement(sql);
this.pst.setInt(1, p.getId());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {
count=this.pst.executeUpdate(); //执行到这里就不动了 但是还不报错 这是什么原因?  
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
this.CloseAll();
}
return count;

[解决办法]
引用:
Quote: 引用:

其他的程序更新了数据库同一行没有提交导致你这个程序block住等待另外的线程释放锁
 应该怎么解决 ? 老大求教

我只是猜测的, 你的update被block了,如果是这样,找到block的session,commit或者kill掉就可
[解决办法]
con.commit; 

热点排行