Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2247713
  • 博文数量: 310
  • 博客积分: 6853
  • 博客等级: 准将
  • 技术积分: 2833
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-04 16:41
文章分类

全部博文(310)

文章存档

2013年(17)

2012年(42)

2011年(76)

2010年(71)

2009年(99)

2007年(2)

2006年(1)

2005年(2)

分类: Java

2009-07-14 13:45:52

用JDBC连接mysql进行

select * from log查询时,
由于表的数据相当多,
当一执行st.executeQuery("select * from dhcp_log")
就报内存溢出错误

可以使用useCursorFetch属性,从而使问题得到解决。

使用该参数确会有 The statement (1) has no open cursor.异常风险。

useCursorFetch If connected to MySQL > 5.0.2, and setFetchSize() > 0 on a statement, should that statement use cursor-based fetching to retrieve rows? false 5.0.0
defaultFetchSize The driver will call setFetchSize(n) with this value on all newly-created Statements 0 3.1.9

阅读(3307) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~