Skip to content

Commit

Permalink
Set a value to 100.
Browse files Browse the repository at this point in the history
Set a default fetch size #17
  • Loading branch information
Andrey Karazhev committed Aug 27, 2020
1 parent 9787b13 commit ce32ae2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ private final static class CREATE_TABLE {
}

private static final class JDBCUtils {
private static final int FETCH_SIZE = 100;

private static void createDataBase(final DataSource dataSource, final Map<String, String> mapping) {
Connection connection = null;
Expand Down Expand Up @@ -969,13 +970,14 @@ private static void set(final PreparedStatement statement, final Config config,
}

private static void set(final PreparedStatement statement, final String[] names) throws SQLException {
statement.setFetchSize(FETCH_SIZE);
for (int i = 0; i < names.length; i++) {
statement.setString(i + 1, names[i]);
}
}

private static void set(final PreparedStatement statement, final PageRequest request)
throws SQLException {
private static void set(final PreparedStatement statement, final PageRequest request) throws SQLException {
statement.setFetchSize(FETCH_SIZE);
statement.setString(1, "%" + request.getName() + "%");

int index = 1;
Expand Down

0 comments on commit ce32ae2

Please sign in to comment.