public List < Integer > getPathOrder ( int profileId ) { ArrayList < Integer > pathOrder = new ArrayList < Integer > ( ) ; PreparedStatement queryStatement = null ; ResultSet results = null ; try ( Connection sqlConnection = sqlService . getConnection ( ) ) { queryStatement = sqlConnection . prepareStatement ( "SELECT * FROM " + Constants . DB_TABLE_PATH + " WHERE " + Constants . GENERIC_PROFILE_ID + " = ? " + " ORDER BY " + Constants . PATH_PROFILE_PATH_ORDER + " ASC" ) ; queryStatement . setInt ( 1 , profileId ) ; results = queryStatement . executeQuery ( ) ; while ( results . next ( ) ) { pathOrder . add ( results . getInt ( Constants . GENERIC_ID ) ) ; } } catch ( SQLException e ) { e . printStackTrace ( ) ; } finally { try { if ( results != null ) { results . close ( ) ; } } catch ( Exception e ) { } try { if ( queryStatement != null ) { queryStatement . close ( ) ; } } catch ( Exception e ) { } } logger . info ( "pathOrder = {}" , pathOrder ) ; return pathOrder ; }
Return collection of path Ids in priority order