public Script getScript ( int id ) { PreparedStatement statement = null ; ResultSet results = null ; try ( Connection sqlConnection = SQLService . getInstance ( ) . getConnection ( ) ) { statement = sqlConnection . prepareStatement ( "SELECT * FROM " + Constants . DB_TABLE_SCRIPT + " WHERE id = ?" ) ; statement . setInt ( 1 , id ) ; results = statement . executeQuery ( ) ; if ( results . next ( ) ) { return scriptFromSQLResult ( results ) ; } } catch ( Exception e ) { } finally { try { if ( results != null ) { results . close ( ) ; } } catch ( Exception e ) { } try { if ( statement != null ) { statement . close ( ) ; } } catch ( Exception e ) { } } return null ; }
Get the script for a given ID