java sqlite insert very slow... my code is this
for(int i = 1 ; i <= list.size(); i++ ) {
query="INSERT OR REPLACE INTO highErrorProbabillityDB VALUES (?,?);";
prep = localError.prepareStatement(query);
prep.setString(1, list.get(i-1).get("ki"));
prep.setInt(2, Integer.parseInt(list.get(i-1).get("ccolor")));
prep.executeUpdate();
}
The first column is primary key and On average, it takes time of about one to 150Milliseconds.
how to optimize this code?