title: Java crash when database is empty
body: <p>I am using the SQLite JDBC driver to access a database, for some reason the application terminates if there are no rows in the database with little explanation as to why it happened.</p>
  
  <p>If the database is not empty it works perfectly fine;</p>
  
  <p>This is where the termination occurs:</p>
  
  <pre><code>public static CustomFillTable Select(String table, String[] column, Object operand) throws SQLException
      {
          Connection connection = null;
          PreparedStatement ps = null;
  
          try
          {  
              StringBuilder query = new StringBuilder();
  
              query.append("select ");
  
              for(int i = 0; i &lt; column.length; i++)
              {
                  query.append(column[i]);
  
                  if(i &lt; column.length -1)
                  {
                      query.append(",");
                  }
              }
  
              query.append(" from ");
              query.append(table);
  
              //Verify usage of where clause
              if(operand != null)
              {
                  query.append(" where ");
                  query.append(operand);
              }
  
              //Termination occurs here
              connection = DriverManager.getConnection(_connectionString);
              connection.setAutoCommit(false);
              ps = connection.prepareStatement(query.toString());
              ResultSet rs = ps.executeQuery();
              connection.commit();
              CustomFillTable model = new CustomFillTable(rs);
              while(rs.next())
              {
                  System.out.println("id = " + rs.getString("id"));
                  System.out.println("name = " + rs.getString("name"));
              }
  
              return model;
          }
  </code></pre>
  
  <p>The application closes at the DriverManager.getConnection line, something I don't find to be related to whether the database is populated or not.</p>
  
  <p>Does anybody know how to fix this problem? I've posted the log dump information <a href="http://pastebin.com/BTuethVz" rel="nofollow">here</a>.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Connection String - </p>
  
  <p><strong>"jdbc:sqlite:D:\Documents\Uni\Semester 2\Languages, Platforms and Tools\Assignment\Java\SQLiteAssignment\mydatabasefile.db"</strong></p>