Redian新闻
>
请教一个sql server的问题
avatar
请教一个sql server的问题# Database - 数据库
c*x
1
我通过jdbc执行一条语句:
INSERT INTO OBJECT VALUES ( 'login' , 'pass' , 1)
结果每次都产生下面的exception:
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]No ResultSet set was
pr
oduced.
不过察看数据库,发现我的insert操作是成功的!!但是我的executeQuery是最后一条语
句啊!
请大侠给个提示是怎么回事,还有为什么会有这个exception, 谢谢先。
avatar
c*x
2
I have already known the answer, don't bother to reply please.
Thanks.

was


【在 c********x 的大作中提到】
: 我通过jdbc执行一条语句:
: INSERT INTO OBJECT VALUES ( 'login' , 'pass' , 1)
: 结果每次都产生下面的exception:
: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]No ResultSet set was
: pr
: oduced.
: 不过察看数据库,发现我的insert操作是成功的!!但是我的executeQuery是最后一条语
: 句啊!
: 请大侠给个提示是怎么回事,还有为什么会有这个exception, 谢谢先。

avatar
m*g
3
Would you please post your answer here? I, and other folks I believe, will be
interested and really appreciated.



【在 c********x 的大作中提到】
: I have already known the answer, don't bother to reply please.
: Thanks.
:
: was
: 语

avatar
c*x
4
The answer is that I misused the executeQUERY(), in fact, we should use
executeUPDATE() instead.
I ever used mysql, which is fine to use executeQuery() for all queries and
updates, but for sql server,the two things are different.
SELECT uses executeQUERY(), INSERT, DELETE, UPDATE use executeUPDATE().

be
set


【在 m*g 的大作中提到】
: Would you please post your answer here? I, and other folks I believe, will be
: interested and really appreciated.
:
: 条

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。