JDBC Fetch Size

Not applicable

JDBC Fetch Size


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

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

Teradata Employee

Re: JDBC Fetch Size

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

More information is available in the Teradata JDBC Driver FAQ: