JDBC Fetch Size

Connectivity

JDBC Fetch Size

Hi,

I am trying to limit the number of rows that are being fetched by the result set at a time using the following code.

Connection conn = DriverManager.getConnection( url, user, pass );
Statement stmt = conn.createStatement();
stmt.setFetchDirection( ResultSet.FETCH_FORWARD );
stmt.setFetchSize( 100 );
ResultSet rs = stmt.executeQuery( "SELECT * FROM table1, table2" );

However, this does not seem to work. The entire result set is being loaded instead of 100 rows at a time.

I am using the latest JDBC Dricer and Terdata DB version 6 release 2.

I looked into the documentation for the JDBC driver and it states "the method is
supported by the Teradata JDBC driver, but is not supported by the Teradata
Database".

Can anyone shed some light on this issue? or is there another way to perform this same task?

Thanks
1 REPLY
Teradata Employee

Re: JDBC Fetch Size

The Statement.setFetchSize method is supported beginning with Teradata JDBC Driver 13.10.00.25 and Teradata Database 13.10.

More information is available in the Teradata JDBC Driver FAQ:

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/faq.html#q7