当前位置: 代码迷 >> Java Web开发 >> 创建Statement对象时出错
  详细解决方案

创建Statement对象时出错

热度:435   发布时间:2007-10-31 21:13:11.0
创建Statement对象时出错

如题:

try{
Connection conn=connect.getconn();//运行到这里没错,
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);这里有错,
sql="insert into UserInfo_table values('"+user.getMyloginname()+"','"+user.getMyusername()+"','"+user.getMypassword()+"','"+user.getMyemail()+"','"+user.getMytype()+"','"+user.getMystatus()+"','"+user.getMymark()+"','"+user.getMylevel()+"','"+user.getCreatTime()+"','"+user.getUpdateTime()+"','"+user.getDeleteTime()+"')";
sql=new String(sql.getBytes("ISO8859-1"),"GB2312");
int i=stmt.executeUpdate(sql);
return i;
}catch(SQLException SqlE){
SqlE.printStackTrace();
return -1;
}catch(Exception E){
E.printStackTrace();
return -2;
}
finally{
connect.close(stmt, rs, conn);
}

当程序运行到那里时就抱如下的错误:
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c921010, pid=2500, tid=3920
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_09-b03 mixed mode)
# Problematic frame:
# C [ntdll.dll+0x1010]
#
# An error report file with more information is saved as hs_err_pid2500.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
这是怎么了啊?要怎么解决啊?希望大家帮帮忙,在线等.




[此贴子已经被作者于2007-10-31 21:59:18编辑过]

搜索更多相关主题的帖子: Statement  对象  

----------------解决方案--------------------------------------------------------
Statement stmt=( Statement)conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
----------------解决方案--------------------------------------------------------

还是没用啊,


----------------解决方案--------------------------------------------------------

请问下,这是什么原因啊?


----------------解决方案--------------------------------------------------------
我试了下可以;
你把完整代码帖上来
----------------解决方案--------------------------------------------------------

好啊,但是有好多的代码哦,


----------------解决方案--------------------------------------------------------
我能加你QQ吗?
----------------解决方案--------------------------------------------------------

发到下面邮箱吧,
csx_hz@126.com


----------------解决方案--------------------------------------------------------
明天我看看,现在寝室要断电了~~~~~
----------------解决方案--------------------------------------------------------

恩,好啊,我们也要快断网了,先谢谢哈,


----------------解决方案--------------------------------------------------------
  相关解决方案