由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 请教一个关于JDBC的问题,实在太烦了!
相关主题
jdbc/odbc MS Access file creation questionRe: JDBC, Java vs. Javascript
Re: JDBC access Oracle?? & Connection PoolingRe: Help! JDBC-ODBC in servlet. Thanks.
jdbc连接数据库出现的问题Re: Interesting thing about JDBC-ODBC! Help please.
jdbc问题一问Problem solved by Re: Desperately need help on DB2 connection through jdbc in jsp page
jdbc statement question[转载] Question 1: refresh view of database?
我只能抗议OracleJDBC了!: 请教一个关于JDBC的问题,实在太烦了!请问个从windows通过jdbc连server的问题
[转载] servlet调用sql 访问oracle的问题JDBC怎样连接FoxPro数据库?
请问JDBC连SQL server的connect reset问题如何解决? (转载)考SCEA归来
相关话题的讨论汇总
话题: jdbc话题: connection话题: st话题: 问题
进入Java版参与讨论
1 (共1页)
w*********y
发帖数: 28
1
我想用JDBC往数据库里插入几条记录,但每次执行到executeUpdate(...),程序就死住了
。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
atement也不行,反正我能想到的都试过了。----有人说是内存溢出,但是只插入一条记
录,怎么会溢出呢?
请问各位有没有遇到类似这样的问题,如何解决?BTW,我用的是Oracle, 以前从来没问
题的。
xt
发帖数: 17532
2


。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St


Did you check your autocommit setting on your java.sql.Connection? If it is
false
you need to explicitly commit or your DB tables will be locked.

【在 w*********y 的大作中提到】
: 我想用JDBC往数据库里插入几条记录,但每次执行到executeUpdate(...),程序就死住了
: 。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
: atement也不行,反正我能想到的都试过了。----有人说是内存溢出,但是只插入一条记
: 录,怎么会溢出呢?
: 请问各位有没有遇到类似这样的问题,如何解决?BTW,我用的是Oracle, 以前从来没问
: 题的。

w*********y
发帖数: 28
3
多谢指教----不过我的程序里没有用setAutoCommit----我现在估计也许是我插入的reco
rd的一些attributes 跟其他table的attributes 有 refer关系。


。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St



【在 xt 的大作中提到】
:
: 了
: 。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
: 记
: 问
: Did you check your autocommit setting on your java.sql.Connection? If it is
: false
: you need to explicitly commit or your DB tables will be locked.

xt
发帖数: 17532
4

这不能解释deadlock.如果是foreign key有问题会有SQLException.

【在 w*********y 的大作中提到】
: 多谢指教----不过我的程序里没有用setAutoCommit----我现在估计也许是我插入的reco
: rd的一些attributes 跟其他table的attributes 有 refer关系。
:
: 住
: 。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
: 条
: 没

w*r
发帖数: 2421
5
foreign key exception should be caught by sqlexception.
My instinct told me that maybe it is the server side, the
admin does not set proper privileage for you.

【在 w*********y 的大作中提到】
: 多谢指教----不过我的程序里没有用setAutoCommit----我现在估计也许是我插入的reco
: rd的一些attributes 跟其他table的attributes 有 refer关系。
:
: 住
: 。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
: 条
: 没

y****i
发帖数: 5690
6
Why not print out the SQL you are trying to execute and run it directly on the
database using the ODBC connecton username/passwd, then you can prove what
wyr's suggestion fit you or not.

reco
。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
is

【在 w*r 的大作中提到】
: foreign key exception should be caught by sqlexception.
: My instinct told me that maybe it is the server side, the
: admin does not set proper privileage for you.

w*r
发帖数: 2421
7
right right.. .this is the basic testing method.. sqlplus will give you
a direct answer...

【在 y****i 的大作中提到】
: Why not print out the SQL you are trying to execute and run it directly on the
: database using the ODBC connecton username/passwd, then you can prove what
: wyr's suggestion fit you or not.
:
: reco
: 。用catch也找不到error,用PreparedStatement也是同样的问题,用新的Connection,St
: is

1 (共1页)
进入Java版参与讨论
相关主题
考SCEA归来jdbc statement question
JDBC的问题 getTableName()我只能抗议OracleJDBC了!: 请教一个关于JDBC的问题,实在太烦了!
a question regarding JDBC driver?[转载] servlet调用sql 访问oracle的问题
问一个数据库字符编码的问题请问JDBC连SQL server的connect reset问题如何解决? (转载)
jdbc/odbc MS Access file creation questionRe: JDBC, Java vs. Javascript
Re: JDBC access Oracle?? & Connection PoolingRe: Help! JDBC-ODBC in servlet. Thanks.
jdbc连接数据库出现的问题Re: Interesting thing about JDBC-ODBC! Help please.
jdbc问题一问Problem solved by Re: Desperately need help on DB2 connection through jdbc in jsp page
相关话题的讨论汇总
话题: jdbc话题: connection话题: st话题: 问题