title: Getting sqlite busy exception [SQLITE_BUSY] The database file is locked (database is locked)
body: <p><strong>EDIT :: closing resultset and statements for queries solved the problem for me</strong></p>
  <p>I am trying to build a chat app by java and sqlite. when i try to insert a new record to a table in data base i am facing data base locked error message. here i try to add new user when they sign up first time:</p>
  <pre><code>public void addNewUser(String username,String password)  {
      StringBuilder sb=new StringBuilder(&quot;INSERT INTO loginInfo VALUES('&quot;);
      sb.append(username);
      sb.append(&quot;','&quot;);
      sb.append(password);
      sb.append(&quot;')&quot;);
      try {
          Statement statement = connection.createStatement();
  
          statement.execute(sb.toString());
          statement.close();
      } catch (SQLException throwables) {
          throwables.printStackTrace();
      }
  }
  </code></pre>
  <p>i am first checking if already same username existed in doesUserExist() function:</p>
  <pre><code>private void handleSignup(String[] tokens) throws IOException, SQLException {
      if(tokens.length==3){
          String username=tokens[1];
          String password=tokens[2];
          String msg=null;
          if(!dataSource.doesUserExists(username)) {
              msg=&quot;signup successful\n&quot;;
              this.login=username;
              dataSource.addNewUser(username,password);
          }
          else msg=&quot;signup unsuccessful\n&quot;;
          this.send(msg);
      }
  }
  </code></pre>
  <p>i get this following error message:</p>
  <pre><code>org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
  at org.sqlite.core.DB.newSQLException(DB.java:1010)
  at org.sqlite.core.DB.newSQLException(DB.java:1022)
  at org.sqlite.core.DB.execute(DB.java:861)
  at org.sqlite.core.CoreStatement.exec(CoreStatement.java:80)
  at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:53)
  </code></pre>
  <p>i have closed the statement after execution of all other queries. what can i do to solve this bug?</p>