private String[] retrieveEnumeration(String schemaTable,String column) throws SQLException {
  String[] enumElements=null;
  String query="SHOW COLUMNS FROM " + schemaTable + " WHERE Field='"+ column+ "'";
  Statement st=null;
  ResultSet rs=null;
  try {
    st=conn.createStatement();
    rs=st.executeQuery(query);
    if (rs.next()) {
      String enumDefinition=rs.getString("Type");
      if (logger.isDebugEnabled())       logger.debug(enumDefinition);
      enumElements=parseListType(enumDefinition);
    }
  }
  finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
      }
    }
    if (st != null) {
      try {
        st.close();
      }
 catch (      SQLException e) {
      }
    }
  }
  return enumElements;
}

private String [ ] retrieveEnumeration ( String schemaTable , String column ) throws SQLException { String [ ] enumElements = null ; String query = "SHOW COLUMNS FROM " + schemaTable + " WHERE Field='" + column + "'" ; Statement st = null ; ResultSet rs = null ; try { st = conn . createStatement ( ) ; rs = st . executeQuery ( query ) ; if ( rs . next ( ) ) { String enumDefinition = rs . getString ( "Type" ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( enumDefinition ) ; enumElements = parseListType ( enumDefinition ) ; } } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( st != null ) { try { st . close ( ) ; } catch ( SQLException e ) { } } } return enumElements ; }
connects to the mysql database , executes show columns for a defined table and parses out allowed enum values to their corresponding string representations .
