Package org.hsqldb

Examples of org.hsqldb.Result$ResultIterator


        if (isEscapeProcessing) {
            sql = connection.nativeSQL(sql);
        }

        if (batchResultOut == null) {
            batchResultOut = new Result(ResultConstants.BATCHEXECDIRECT,
                                        new int[]{ Types.VARCHAR }, 0);
        }

        batchResultOut.add(new Object[]{ sql });
    }
View Full Code Here


        checkClosed();
        connection.clearWarningsNoCheck();

        if (batchResultOut == null) {
            batchResultOut = new Result(ResultConstants.BATCHEXECDIRECT,
                                        new int[]{ Types.VARCHAR }, 0);
        }

        batchCount = batchResultOut.getSize();
View Full Code Here

     */
    protected void finishStream() throws IOException {}

    protected void writeDDL() throws IOException, HsqlException {

        Result ddlPart = DatabaseScript.getScript(database,
            !includeCachedData);

        writeSingleColumnResult(ddlPart);
    }
View Full Code Here

    }

    protected void readDDL(Session session)
    throws IOException, HsqlException {

        Result   r  = Result.read(rowIn, dataStreamIn);
        Iterator it = r.iterator();

        while (it.hasNext()) {
            Object[] data   = (Object[]) it.next();
            String   s      = (String) data[0];
            Result   result = session.sqlExecuteDirectNoPreChecks(s);

            if (result.isError()) {
                db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
                                            result.getMainString());

                /** @todo fredt - trap if unavaialble external functions are to be ignored */
                throw Trace.error(result);
            }
        }
View Full Code Here

        if (isEscapeProcessing) {
            sql = connection.nativeSQL(sql);
        }

        if (batchResultOut == null) {
            batchResultOut = new Result(ResultConstants.BATCHEXECDIRECT,
                                        new int[]{ Types.VARCHAR }, 0);
        }

        batchResultOut.add(new Object[]{ sql });
    }
View Full Code Here

        checkClosed();
        connection.clearWarningsNoCheck();

        if (batchResultOut == null) {
            batchResultOut = new Result(ResultConstants.BATCHEXECDIRECT,
                                        new int[]{ Types.VARCHAR }, 0);
        }

        batchCount = batchResultOut.getSize();
View Full Code Here

                    sessionMap.remove(currentId);

                    continue;
                }

                Result result = null;

                switch (scr.getStatementType()) {

                    case ScriptReaderBase.ANY_STATEMENT :
                        result = current.sqlExecuteDirectNoPreChecks(
                            scr.getLoggedStatement());

                        if (result != null && result.isError()) {
                            if (result.getException() != null) {
                                throw result.getException();
                            }

                            throw Trace.error(result);
                        }
                        break;
View Full Code Here

                isInsert = true;

                break;
            }

            Result result = session.sqlExecuteDirectNoPreChecks(statement);

            if (result != null && result.isError()) {
                db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
                                            result.getMainString());

                HsqlException error =
                    Trace.error(Trace.ERROR_IN_SCRIPT_FILE,
                                Trace.DatabaseScriptReader_readDDL,
                                new Object[] {
                    new Integer(lineCount), result.getMainString()
                });

                /** @todo fredt - if unavaialble external functions are to be ignored */
                throw error;
            }
View Full Code Here

     */
//#ifdef JAVA4
    public synchronized Savepoint setSavepoint(String name)
    throws SQLException {

        Result req;

        checkClosed();

        if (name == null) {
            String msg = "name is null";
View Full Code Here

    public synchronized void rollback(Savepoint savepoint)
    throws SQLException {

        String        msg;
        jdbcSavepoint sp;
        Result        req;

        checkClosed();

        if (savepoint == null) {
            msg = "savepoint is null";

            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
        }

        try {
            if (sessionProxy.isAutoCommit()) {
                msg = "connection is autocommit";

                throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
            }
        } catch (HsqlException e) {
            throw Util.sqlException(e);
        }

// fredt - might someone call this with a Savepoint from a different driver???
        if (!(savepoint instanceof jdbcSavepoint)) {
            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
        }

        sp = (jdbcSavepoint) savepoint;

        if (this != sp.connection) {
            msg = savepoint + " was not issued on this connection";

            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT, msg);
        }

        req = Result.newRollbackToSavepointRequest(sp.name);

        try {
            Result result = sessionProxy.execute(req);

            if (result.isError()) {
                Util.throwError(result);
            }
        } catch (HsqlException e) {
            Util.throwError(e);
        }
View Full Code Here

TOP

Related Classes of org.hsqldb.Result$ResultIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.