分类: 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 |