title: How do I check to see if a column name exists in a CachedRowSet?
body: <p>I am querying data from views that are subject to change. I need to know if the column exists before I do a <code>crs.get******()</code>.</p>
  <p>I have found that I can query the <em>metadata</em> like this to see if a column exist before I request the data from it:</p>
  <pre><code>ResultSetMetaData meta = crs.getMetaData();
  int numCol = meta.getColumnCount();
  
  for (int i = 1; i &lt; numCol + 1; i++) 
      if (meta.getColumnName(i).equals(&quot;name&quot;))
          return true;
  </code></pre>
  <p>Is there a simpler way of checking to see if a column exists?</p>
  <hr />
  <h3>EDIT</h3>
  <p>It must be database agnostic. That is why I am referencing the <code>CachedRowSet</code> instead of the database.</p>