public List < Timestamp > getRevisionTimestamps ( final int articleID ) throws WikiApiException { List < Timestamp > timestamps = new LinkedList < Timestamp > ( ) ; try { if ( articleID < 1 ) { throw new IllegalArgumentException ( ) ; } PreparedStatement statement = null ; ResultSet result = null ; try { // Check if necessary index exists if ( ! indexExists ( "revisions" ) ) { throw new WikiInitializationException ( "Please create an index on revisions(ArticleID) in order to make this query feasible." ) ; } statement = connection . prepareStatement ( "SELECT Timestamp " + "FROM revisions WHERE ArticleID=?" ) ; statement . setInt ( 1 , articleID ) ; result = statement . executeQuery ( ) ; // Make the query if ( result == null ) { throw new WikiPageNotFoundException ( "The article with the ID " + articleID + " was not found." ) ; } while ( result . next ( ) ) { timestamps . add ( new Timestamp ( result . getLong ( 1 ) ) ) ; } } finally { if ( statement != null ) { statement . close ( ) ; } if ( result != null ) { result . close ( ) ; } } return timestamps ; } catch ( WikiApiException e ) { throw e ; } catch ( Exception e ) { throw new WikiApiException ( e ) ; } }
Returns the timestamps of all revisions connected to the specified article .