Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助(SQL, 查询时返回记录的行数)
lys0410





发贴: 3
积分: 0
于 2006-08-19 17:36 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
请问:JAVA类中哪个类的方法在连接数据库查询记录时能返回记录的行数?

why edited on 2006-08-19 20:11

作者 Re:求助 [Re:lys0410]
Novo





发贴: 39
积分: 0
于 2006-08-19 18:01 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
用查询语言也可以实现啊.
select Count(*) from xxxxxx wherexxxxxx


why edited on 2006-08-19 20:11

要改变命运,先改变自己.
作者 Re:求助 [Re:lys0410]
lys0410





发贴: 3
积分: 0
于 2006-08-19 18:23 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
那个我知道
但是在连接数据库时,在JAVA中的发送SQL文时可以写多少行的SQL语句呢?
只能写一条吗?



作者 Re:求助(发送SQL文时可以写多少行) [Re:lys0410]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2006-08-19 20:24 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
lys0410 wrote:
那个我知道
但是在连接数据库时,在JAVA中的发送SQL文时可以写多少行的SQL语句呢?
只能写一条吗?

if the DB server supports this, you could have multiple SQL statements in a String and use execute() instead of executeQuery() or executeUpdate(), and then getMoreResults() or getUpdateCount() to retrieve individual ResultSet or update count.



作者 Re:求助(SQL, 查询时返回记录的行数) [Re:lys0410]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2006-08-20 07:42 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jdbc 有 执行一条 SQL,也可以 批量执行 SQL,同样SQL只是可以传入参数,批量执行


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923