tags:

views:

298

answers:

1

I’m trying to get a large result set to stream and having no luck. The MySQL docs are somewhat unclear as to whether this should even work. E.g.:

When using versions of the JDBC driver earlier than 3.2.1, and connected to server versions earlier than 5.0.3, the setFetchSize() method has no effect, other than to toggle result set streaming as described above.

I'm using MySQL 4.1.19 with Connector/J 5.1.6. My code is basically:

stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(Integer.MIN_VALUE);
stmt.executeQuery(“select * from huge_table”);

Are streaming result sets possible with MySQL 4.1.x? And if so, how?

Thanks.

+1  A: 

What you are looking for is called "unbuffered query" in MySQL lingo, but a quick search seems to indicate that:

  • MySQL only supports it starting from version 5.0
  • JDBC doesn't support it
Cd-MaN