# ojdbc

Published articles for ojdbc.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Setting the JDBC Statement.setFetchSize() to 1 for Single Row Queries

DevFeed: [Setting the JDBC Statement.setFetchSize() to 1 for Single Row Queries](<https://devfeed.tech/articles/setting-the-jdbc-statement-setfetchsize-to-1-for-single-row-queries-28959.md>)

Original publisher: [Read original article](<https://blog.jooq.org/setting-the-jdbc-statement-setfetchsize-to-1-for-single-row-queries/>)

Author: lukaseder

Published: 2022-05-11T08:55:41Z

Content type: article

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [rdbms](<https://devfeed.tech/topics/rdbms.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [db2](<https://devfeed.tech/tags/db2.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [fetch-size](<https://devfeed.tech/tags/fetch-size.md>), [fetchsize](<https://devfeed.tech/tags/fetchsize.md>), [jdbc](<https://devfeed.tech/tags/jdbc.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-development](<https://devfeed.tech/tags/jooq-development.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [ojdbc](<https://devfeed.tech/tags/ojdbc.md>), [optimisation](<https://devfeed.tech/tags/optimisation.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>)

### AI overview

This article examines whether jOOQ should call JDBC Statement.setFetchSize(1) by default for queries expected to return at most one row. It proposes measuring the effect with a JMH benchmark and discusses limitations on comparing execution speed across RDBMS.

### Source excerpt

An interesting hint by Vladimir Sitnikov has made me think about a new benchmark for jOOQ: The benchmark should check whether single row queries should have a JDBC Statement.setFetchSize(1) call made to them by default. The Javadoc of the method says: Gives the JDBC driver a hint as to the number of rows that should ... Continue reading Setting the JDBC Statement.setFetchSize() to 1 for Single Row Queries ->