Code example for ResultSetMetaData

Methods: getColumnName

0
         throw new IllegalStateException( "Not Connected to Database" );
 
      // determine column name 
      try  
      { 
         return metaData.getColumnName( column + 1 );  
      } // end try 
      catch ( SQLException sqlException ) 
      { 
         sqlException.printStackTrace();
      } // end catch 
       
      return ""; // if problems, return empty string for column name 
   } // end method getColumnName 
 
   // return number of rows in ResultSet 
   public int getRowCount() throws IllegalStateException 
   {       
      // ensure database connection is available 
      if ( !connectedToDatabase ) 
         throw new IllegalStateException( "Not Connected to Database" );