empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Richmond <crichm...@referentia.com>
Subject Batch inserts
Date Thu, 30 Aug 2012 02:50:48 GMT
With pure JDBC I can do a PreparedStamement(ps) with batches for inserting
large numbers of rows(millions) with my embedded H2 database.  This works
fine(along with setting autocommit OFF on my connection)
        int count = 0;

        for(int x = 1; x <= totalRows; x++){


          for(<each item of data I have, up to millions>){
            pst.setInt(colIndex, rowIndex);
          }

          pst.addBatch();
          if(++count % batchSize == 0) {
            pst.executeBatch();   //execute batches at specified invervals
(batchSize)

          }

        }


        pst.executeBatch(); // insert remaining records

        pst.close();

but I am now trying to use EmpireDB and it is unclear if I can do batch
inserts against the database usinge the EmpireDB api.  Is this possible and
is there sample code for how to configure or execute against the API do
this?

In summary, I want batch insertion for large sets of data(millions of
rows), executing batches of inserts at regular intervals like I was doing
with pure JDBC above.

Thanks,
Chris

Mime
View raw message