title: Derby - java.sql.SQLException: Column 'table.column_name' not found
body: <p>I have these 2 tables: <code>inventory</code> and <code>product_categories</code> both tables have a common column called <code>businessId</code>.</p>
  
  <p>Now I have 2 databases, one is hosted on MySQL and the other on Derby both databases have same table structures.</p>
  
  <p>So I've been executing the following query on both databases:</p>
  
  <pre><code>SELECT * 
  FROM INVENTORY
  INNER JOIN PRODUCT_CATEGORIES
      ON INVENTORY.BUSINESSID = PRODUCT_CATEGORIES.BUSINESSID
      AND INVENTORY.CATEGORY = PRODUCT_CATEGORIES.CATEGORYNAME
  WHERE INVENTORY.BUSINESSID = 1
  </code></pre>
  
  <p>When I execute the query above using the Java code below, I get a successful <code>ResultSet</code> in both databases, however Derby throws an exception when I attempt to get the <code>businessId</code> column from the <code>product_categories</code> table</p>
  
  <pre><code>try(Connection conn = dbConfig.getDatabaseConnection())
  {
      PreparedStatement pst = conn.prepareStatement(sql);
      pst.setInt(1, businessId);
      List&lt;Product&gt; products = new ArrayList&lt;&gt;();
      ResultSet rs = pst.executeQuery();
      while(rs.next())
      {
          ...
          int businessId = rs.getInt("product_categories.businessId"); //&lt;-- This lines throws an exception
          ...
      }
  }
  </code></pre>
  
  <p>I am getting this error message:</p>
  
  <blockquote>
    <p>java.sql.SQLException: Column 'product_categories.businessId' not found</p>
  </blockquote>
  
  <p>Please what is going wrong here?</p>