You are incrementing i
twice, one in the for and one in the print statement, change this to
for( i=0; i < words.size();i++)
{
String[] pair=words.get(i).split(",");
insertWord(pair[0].trim(), Integer.parseInt(pair[1].trim()), db);
System.out.println(i);
}