title: ArrayOutOfBoundsException on PreparedStatement
body: <p>I'm at a loss here, can anyone see what's wrong with this code? I'm using sqlite with this driver:
  <a href="https://bitbucket.org/xerial/sqlite-jdbc/downloads" rel="nofollow">https://bitbucket.org/xerial/sqlite-jdbc/downloads</a></p>
  
  <p>edit: fixed my initial error but have a similar one</p>
  
  <pre><code>public void insertTweets(final List&lt;WatchedTweet&gt; tweets) {
      try {
          final PreparedStatement stmt = connection.prepareStatement(
              "insert into tweets(tweet_id, user_id, campaign_id, retweet_count, date) values(?,?,?,?,?)"
          );
          for(WatchedTweet tweet : tweets) {
              stmt.setLong(1, tweet.getID());
              stmt.setLong(2, tweet.getParent().getTwitterID());
              stmt.setInt(3, tweet.getParent().getCampaignID());
              stmt.setInt(4, tweet.getRetweetCount());
              stmt.setLong(5, tweet.getAdded().getTime());
              stmt.addBatch();
              stmt.clearParameters();
          }
          stmt.executeBatch();
          stmt.close();
      } catch (SQLException sqe) {
          sqe.printStackTrace();
      }
  }
  </code></pre>
  
  <p>I get an exception at this line:</p>
  
  <p><code>stmt.setLong(1, tweet.getID());</code></p>
  
  <p>The exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
  at org.sqlite.core.CorePreparedStatement.batch(CorePreparedStatement.java:110)
  at org.sqlite.jdbc3.JDBC3PreparedStatement.setLong(JDBC3PreparedStatement.java:298)
  at tweetserver.server.db.TwitterDB.insertTweets(TwitterDB.java:75)
  at tweetserver.server.rest.TwitterBot.updateTimelineUntilDate(TwitterBot.java:138)
  at tweetserver.server.rest.TwitterBot.process(TwitterBot.java:49)
  at tweetserver.server.rest.TwitterBot.&lt;init&gt;(TwitterBot.java:44)
  at tweetserver.server.Application.bootstrap(Application.java:25)
  at tweetserver.server.Application.main(Application.java:20)
  </code></pre>
  
  <p>This is how I created the table</p>
  
  <pre><code>"create table if not exists tweets (" +
              "id integer PRIMARY KEY AUTOINCREMENT," +
              "tweet_id long NOT NULL," +
              "user_id long NOT NULL," +
              "campaign_id int NOT NULL, " +
              "retweet_count int NOT NULL, " +
              "date long NOT NULL)"`
  </code></pre>