/** * Retrieves the next object constructed by the assembler engine. * * <p> * * <DL> * <DT><B>Parameters:</B> * <DD>None. * </DL> * * @return <CODE>Object</CODE> - The next object in the iterator. * @exception QMException Thrown if an error occurs while trying to retrieve the next object. * @include */ public Object next() throws QMException { Object object = masmEngine.next(); if (object == null) { masmEngine.close(); } return object; }
/** * Returns a Boolean indicator of whether the iterator contains a next object to retrieve. * * <p> * * <DL> * <DT><B>Parameters:</B> * <DD>None. * </DL> * * @return <CODE>Boolean</CODE> - An indicator of whether there is another object to retrieve. * <B>True</B> indicates there is an object to retrieve; <B>false</B> indicates there is not. * @exception QMException Thrown if an error occurs while checking for the next object in the * iterator. include */ public boolean hasNext() throws QMException { boolean more = masmEngine.hasNext(); if (!more) { masmEngine.close(); QueryManagerImpl.decrementConnectionCounter(); } return more; }
/** * Clones the given instance of the QMIterator class. This method is internal to the Query Manager * framework. * * <p> * * <DL> * <DT><B>Parameters:</B> * <DD>None. * </DL> * * @return <CODE>Object</CODE> - A copy of the given QMIterator object. * @exception CloneNotSupportedException Thrown to indicate that the object could not be cloned. * @include */ public Object clone() throws CloneNotSupportedException { QMIterator iterator = (QMIterator) super.clone(); if (masmEngine != null) { iterator.masmEngine = (AssemblerEngine) masmEngine.clone(); } return iterator; }
/** * This method initializes the data structures that are used during run time and can be writeable. * * @param con Connection * @param resultSets ResultSet[] * @param statements Statement[] * @param maxRows maximum number of rows * @param closeDbConnection set to true if the database connection is to be closed by the * AssemblerEngine, false if some other calling class is to close the database connection * instead. * @throws QMException QMException */ void initRun( Connection con, ResultSet[] resultSets, Statement[] statements, int maxRows, boolean closeDbConnection) throws QMException { masmEngine.initRun(con, resultSets, statements, maxRows, closeDbConnection); }
/* * This method initializes the data structures that can be shared and cached * (only readable data structures) */ void initCompile(SQLDescriptor[] sqlDesc, AssembleDescriptor assDesc) throws QMException { msqlDesc = sqlDesc; massDesc = assDesc; masmEngine = assDesc.getAssemblerEngine(); if (masmEngine == null) { masmEngine = new AssemblerEngineImpl(); assDesc.setAssemblerEngine(masmEngine); } masmEngine.initCompile(sqlDesc, assDesc); mrootObjectName = sqlDesc[0].getRoot(); }
/** * Closes the connection to the database. * * <p> * * <DL> * <DT><B>Parameters:</B> * <DD>None. * </DL> * * <DL> * <DT><B>Returns:</B> * <DD><CODE>void</CODE> - None. * </DL> * * @exception QMException Thrown if an error occurs while closing the connection. * @include */ public void close() throws QMException { masmEngine.close(); }