title: Cannot authorize request to Google fusion tables API
body: <p>I am writing a small java installed application, that will be run on a desktop, to interact with a google fusion table and I keep getting a 401 unauthorized error. Here is the code I am using to connect to and query the table:</p>
  
  <pre><code>/** Global instance of the HTTP transport. */
  private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
  /** Global instance of the JSON factory. */
  private static final JsonFactory JSON_FACTORY = new JacksonFactory();
  
  private static void insertData(String query) throws IOException {
      BasicAuthentication credential = new BasicAuthentication(username, password);
      fusiontables = new Fusiontables.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).setApplicationName(
              "Google-FusionTablesSample/1.0").build();
      Query q = fusiontables.query();
      Sql sql = q.sql(query);
  
      try {
          sql.execute();
      } catch (IllegalArgumentException e) {
  
      }
  }
  </code></pre>
  
  <p>The table was created in my account and I am using my account's username and password, so I know it's not that I am using the wrong login info. This is my first time doing anything with java and oauth so can anyone help me figure out what I am doing wrong here?</p>