private double[][] selectCounts(String table, int[] indices) throws SQLException {
    //Load up JDBC.
    try {
      Class.forName("org.sqlite.JDBC");
    }
    catch (ClassNotFoundException e) {
      e.printStackTrace();
      return null;
    }
    
    String command = "SELECT * FROM " + table
                    + " WHERE name IN (";

    //Specify which rows we're selecting.
    for (int i = 0; i < indices.length; i += 1) {
      command += indices[i] + (i == indices.length ? ")" : ", ");
    }
    
    //Open our connection.
    Connection connection = DriverManager.getConnection("jdbc:sqlite:" + dbPath);

    //Create our statement.
    Statement statement = connection.createStatement();

    //Make our query.
    ResultSet result = statement.executeQuery(command);

    //Scroll to the first result.

    //See how many columns there are:
    double[][] r = new double[indices.length][result.getMetaData().getColumnCount() - 1];
    
    //Scroll through our results and put them into a big array of doubles.
    for (int i = 1; i <= indices.length; i += 1) {
     result.absolute(i);
     for (int x = 2; x <= r[i].length + 1; x += 1) {
       r[i][x] = result.getDouble(i);
     }
    }

    connection.close();

    return r;
  }