Вставить 1 000 000 записей используя jdbc

Как вставить 1 000 000 записей используя jdbc. Время не должно превышать 5 мин.

public static boolean saveDbFile( int size )  {


    try (Connection c = getConnection()) {
        c.setAutoCommit(false);
        String sql = "insert into  test (FIELD) values (?)";
        PreparedStatement ps = c.prepareStatement(sql);
        ps.setInt(1, size );

        ps.execute();
        c.commit();

    } catch (Exception ex) {
        throw new RuntimeException(ex);

    }
    return false;
}

Ответы (0 шт):