Package org.jdbi.v3.core.statement
Class StatementCustomizers
- java.lang.Object
-
- org.jdbi.v3.core.statement.StatementCustomizers
-
public final class StatementCustomizers extends java.lang.ObjectSome simpleStatementCustomizers you might find handy.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateStatementCustomizers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StatementCustomizerfetchSize(int fetchSize)Set the number of rows to fetch from the database in a single batch.static StatementCustomizermaxFieldSize(int maxFieldSize)Sets the limit of large variable size types likeVARCHAR.static StatementCustomizermaxRows(int maxRows)Limit number of rows returned.static StatementCustomizerstatementTimeout(int seconds)Set a timeout on the statement.
-
-
-
Method Detail
-
statementTimeout
public static StatementCustomizer statementTimeout(int seconds)
Set a timeout on the statement.- Parameters:
seconds- timeout in seconds- Returns:
- the customizer
-
fetchSize
public static StatementCustomizer fetchSize(int fetchSize)
Set the number of rows to fetch from the database in a single batch. In a transaction, may enable streaming result sets instead of buffering in memory.- Parameters:
fetchSize- number of rows to fetch at a time- Returns:
- the customizer
-
maxRows
public static StatementCustomizer maxRows(int maxRows)
Limit number of rows returned. Note that this may be significantly less efficient than doing it in the SQL with aLIMITclause and is not recommended unless you understand why you need it specifically.- Parameters:
maxRows- number of rows to return- Returns:
- the customizer
-
maxFieldSize
public static StatementCustomizer maxFieldSize(int maxFieldSize)
Sets the limit of large variable size types likeVARCHAR. Limited data is silently discarded, so be careful!- Parameters:
maxFieldSize- the maximum field size to return- Returns:
- the customizer
-
-