由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 请教高手一个JDBC的问题!
相关主题
HELP! SQL Server vs JDBC questionJDBC
JDBC如何获取新加入的记录的索引求助,哪儿能找到一些实用的面试习题?
jdbc statement questionJDBC or SQL-C?
关于java执行SQL之后的内存问题?真诚求助 (JAVA校友录)
DATE TIME In RDBMS MS SQL Server JDBC Driver Problem
对 spring 的 exception 处理方式真是不适应JDBC & Firewall
现在的工作完全不用spring,hibernate,以后跳槽是不是会显得很弱?我只能抗议OracleJDBC了!: 请教一个关于JDBC的问题,实在太烦了!
[转载] Question 1: refresh view of database?Re: SQL Server 2000 Driver for JDBC - Er
相关话题的讨论汇总
话题: insert话题: values话题: fact话题: statement话题: jdbc
进入Java版参与讨论
1 (共1页)
w*********y
发帖数: 28
1
我坚信(经验证)database,listener都是好的。也可以建立Connection,Statement。
但执行下面这段语句,就死住了,没有任何错误信息返回,也catch不了任何error。
fact_iRowCount += stmt1.executeUpdate("INSERT INTO fact"+
" VALUES(1,758,1,748,12,6,190)");
况且,"INSERT INTO fact VALUES(1,758,1,748,12,6,190)"在SQL/PLUS 下执行是正确的

大家看可能是什么问题?多谢了!
z****g
发帖数: 2497
2
试试PreparedStatement instead of Statement.
然后看看能不能做query. 不能的话, 很可能是driver有问题。
但是不能catch exception 有点奇怪。除非在driver里面死循环了。

【在 w*********y 的大作中提到】
: 我坚信(经验证)database,listener都是好的。也可以建立Connection,Statement。
: 但执行下面这段语句,就死住了,没有任何错误信息返回,也catch不了任何error。
: fact_iRowCount += stmt1.executeUpdate("INSERT INTO fact"+
: " VALUES(1,758,1,748,12,6,190)");
: 况且,"INSERT INTO fact VALUES(1,758,1,748,12,6,190)"在SQL/PLUS 下执行是正确的
: 。
: 大家看可能是什么问题?多谢了!

xt
发帖数: 17532
3

最好是把field名字都写出来.

【在 z****g 的大作中提到】
: 试试PreparedStatement instead of Statement.
: 然后看看能不能做query. 不能的话, 很可能是driver有问题。
: 但是不能catch exception 有点奇怪。除非在driver里面死循环了。

x***n
发帖数: 39
4
When no exception is thrown, I assume your program was still trying to
talk to the RDBMS server. Check the network traffic by using some sort
of listening software such as ethereal or commview. At the same time,
try to replace the server with another one, or try using another RDBMS
such as using MySQL. Also you can try issueing a dummy select statement
and see if it works.

【在 w*********y 的大作中提到】
: 我坚信(经验证)database,listener都是好的。也可以建立Connection,Statement。
: 但执行下面这段语句,就死住了,没有任何错误信息返回,也catch不了任何error。
: fact_iRowCount += stmt1.executeUpdate("INSERT INTO fact"+
: " VALUES(1,758,1,748,12,6,190)");
: 况且,"INSERT INTO fact VALUES(1,758,1,748,12,6,190)"在SQL/PLUS 下执行是正确的
: 。
: 大家看可能是什么问题?多谢了!

st
发帖数: 1685
5
要是我,就先executeQuery看看。也会hang么?

【在 x***n 的大作中提到】
: When no exception is thrown, I assume your program was still trying to
: talk to the RDBMS server. Check the network traffic by using some sort
: of listening software such as ethereal or commview. At the same time,
: try to replace the server with another one, or try using another RDBMS
: such as using MySQL. Also you can try issueing a dummy select statement
: and see if it works.

x***n
发帖数: 39
6
This is definitely the best way to do. :-)
I was just trying to throw out some stuff for him to do.

【在 st 的大作中提到】
: 要是我,就先executeQuery看看。也会hang么?
1 (共1页)
进入Java版参与讨论
相关主题
Re: SQL Server 2000 Driver for JDBC - ErDATE TIME In RDBMS
a question regarding JDBC driver?对 spring 的 exception 处理方式真是不适应
改写(migrate) stored proc 问题现在的工作完全不用spring,hibernate,以后跳槽是不是会显得很弱?
Hibernate question[转载] Question 1: refresh view of database?
HELP! SQL Server vs JDBC questionJDBC
JDBC如何获取新加入的记录的索引求助,哪儿能找到一些实用的面试习题?
jdbc statement questionJDBC or SQL-C?
关于java执行SQL之后的内存问题?真诚求助 (JAVA校友录)
相关话题的讨论汇总
话题: insert话题: values话题: fact话题: statement话题: jdbc