public static boolean hasField ( Connection connection , String tableName , String fieldName ) throws SQLException { final Statement statement = connection . createStatement ( ) ; try { final ResultSet resultSet = statement . executeQuery ( "SELECT * FROM " + TableLocation . parse ( tableName ) + " LIMIT 0;" ) ; try { return hasField ( resultSet . getMetaData ( ) , fieldName ) ; } finally { resultSet . close ( ) ; } } catch ( SQLException ex ) { return false ; } finally { statement . close ( ) ; } }
Return true if table tableName contains field fieldName .