No statements may be issued when any streaming result sets are open and in use on a given connection
来源:互联网 发布:淘宝货源 编辑:程序博客网 时间:2024/05/16 11:41
Noways, i have encountered a problem about mysql and ResultSet.
the Exception Trace:
java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@7834eb is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:2646)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1861)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1846)
By default, ResultSets are completely retrieved and stored in memory. In most cases this is the most efficient way to operate, and due to the design of the MySQL network protocol is easier to implement. If you are working with ResultSets that have a large number of rows or large values, and can not allocate heap space in your JVM for the memory required, you can tell the driver to stream the results back one row at a time.
To enable this functionality, you need to create a Statement instance in the following manner:
stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);stmt.setFetchSize(Integer.MIN_VALUE);
The combination of a forward-only, read-only result set, with a fetch size of Integer.MIN_VALUE
serves as a signal to the driver to stream result sets row-by-row. After this any result sets created with the statement will be retrieved row-by-row.
There are some caveats with this approach. You will have to read all of the rows in the result set (or close it) before you can issue any other queries on the connection, or an exception will be thrown.
Reference: http://bugs.mysql.com/bug.php?id=39156
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-implementation-notes.html
- No statements may be issued when any streaming result sets are open and in use on a given connection
- ERROR Streaming result set com.mysql.jdbc.RowDataDynamic@1d5a7f6 is still active. No statements may
- ERROR Streaming result set com.mysql.jdbc.RowDataDynamic@1d5a7f6 is still active. No statements may
- 使用sqoop时,Ensure that you have called .close() on any active streaming result sets before attempting
- No SAP systems are available when creating a new connection off an SAP source in Crystal Reports.
- Use MFC in a Static Library,This may be due to a corruption of the heap....
- 135 Which three statements are true about windows? (Choose three.) A. Only one window can be open at
- 155 Which three statements are true about windows? (Choose three.) A. Only one window can be open at
- 117.Which statements are true regarding the WHERE and HAVING clauses in a SELECT statement?
- Several ports (8005, 8080, 8009) required by demo are already in use. The server may already be runn
- 7.Which two statements are true regarding the USING and ON clauses in table joins? (Choose two.)
- OS error EEXIST was thrown when db2start was issued in a single node environment.
- Connection must be valid and open
- C#Connection must be valid and open?
- 1386271 - No SAP or SAP BW systems available when creating a new connection in Crystal Reports.
- ubuntu/wireshark: There are no interfaces on which a capture can be done.故障解决
- 【wireshark】wireshark 出现There are no interfaces on which a capture can be done.的解决方法
- wireshark: There are no interfaces on which a capture can be done.故障解决
- python copy详解
- android apk的反编译
- iPhone开发问题
- 知识积累
- DevExpress Asp.net ASPxTreeList的基本使用之一
- No statements may be issued when any streaming result sets are open and in use on a given connection
- MySQL+Replication(复制)基本原理
- java操作excel,pdf的方法
- .net中的break、continue、return之间的区别
- socket中send函数和recv函数
- iPhone 开发过程中的一些小技术的总结
- JSFL导出FLA中的文本内容
- linux 设备驱动程序 hello+param
- 十六进制转换成字符串