Random r = new Random();
Query insQuery = sql2o.createQuery("insert into post (text, creation_date, last_change_date, counter1, counter2, counter3, counter4, counter5, counter6, counter7, counter8, counter9) values (:text, :creation_date, :last_change_date, :counter1, :counter2, :counter3, :counter4, :counter5, :counter6, :counter7, :counter8, :counter9)");
for (int idx = 0; idx < ITERATIONS; idx++)
{
insQuery.addParameter("text", "a name " + idx)
.addParameter("creation_date", new DateTime(System.currentTimeMillis() + r.nextInt()).toDate())
.addParameter("last_change_date", new DateTime(System.currentTimeMillis() + r.nextInt()).toDate())
.addParameter("counter1", r.nextDouble() > 0.5 ? r.nextInt() : null)
.addParameter("counter2", r.nextDouble() > 0.5 ? r.nextInt() : null)
.addParameter("counter3", r.nextDouble() > 0.5 ? r.nextInt() : null)