Package org.hsqldb

Examples of org.hsqldb.HsqlException


                        System.gc();
                        logSevereEvent(dataFileName
                                       + " getFromFile out of mem " + pos, t);

                        if (j > 0) {
                            HsqlException ex =
                                Error.error(ErrorCode.OUT_OF_MEMORY, t);

                            ex.info = rowIn;

                            throw ex;
                        }
                    } else {
                        HsqlException ex =
                            Error.error(ErrorCode.GENERAL_IO_ERROR, t);

                        ex.info = rowIn;

                        throw ex;
View Full Code Here


            rowIn.resetRow(pos, size);
            dataFile.read(rowIn.getBuffer(), 4, size - 4);
        } catch (Throwable t) {
            logSevereEvent("DataFileCache.readObject", t, pos);

            HsqlException ex = Error.error(ErrorCode.DATA_FILE_ERROR, t);

            if (rowIn.getPos() != pos) {
                rowIn.resetRow(pos, 0);
            }
View Full Code Here

            dataFile.seek(pos * dataFileScale);
            dataFile.read(rowIn.getBuffer(), 0, size);
        } catch (Throwable t) {
            logSevereEvent("DataFileCache.readObject", t, pos);

            HsqlException ex = Error.error(ErrorCode.DATA_FILE_ERROR, t);

            ex.info = rowIn;

            throw ex;
        }
View Full Code Here

        int dbIndex = ArrayUtil.find(dbAlias, alias);

        if (dbIndex == -1) {
            if (filepath == null) {
                HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                              "database alias does not exist");

                printError("database alias=" + alias + " does not exist");
                setServerError(e);
View Full Code Here

     * Open and return database index
     */
    final int openDatabase(String alias, String datapath) {

        if (!isRemoteOpen) {
            HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                          "remote open not allowed");

            printError("Remote database open not allowed");
            setServerError(e);

            throw e;
        }

        int i = getFirstEmptyDatabaseIndex();

        if (i < -1) {
            i = closeOldestDatabase();

            if (i < -1) {
                HsqlException e =
                    Error.error(ErrorCode.GENERAL_ERROR,
                                "limit of open databases reached");

                printError("limit of open databases reached");
                setServerError(e);

                throw e;
            }
        }

        HsqlProperties newprops = DatabaseURL.parseURL(datapath, false, false);

        if (newprops == null) {
            HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                          "invalid database path");

            printError("invalid database path");
            setServerError(e);

            throw e;
        }

        String path = newprops.getProperty(DatabaseURL.url_database);
        String type = newprops.getProperty(DatabaseURL.url_connection_type);

        try {
            int dbid = DatabaseManager.getDatabase(type, path, this, newprops);

            dbID[i]             = dbid;
            dbActionSequence[i] = actionSequence;
            dbAlias[i]          = alias;
            dbPath[i]           = path;
            dbType[i]           = type;
            dbProps[i]          = newprops;

            return i;
        } catch (HsqlException e) {
            printError("Database [index=" + i + ", db=" + dbType[i]
                       + dbPath[i] + ", alias=" + dbAlias[i]
                       + "] did not open: " + e.toString());
            setServerError(e);

            throw e;
        }
    }
View Full Code Here

        if (isClosed()) {
            return;
        }
        closeResultData();

        HsqlException he = null;

        try {

            // fredt - if this is called by Connection.close() then there's no
            // need to free the prepared statements on the server - it is done
View Full Code Here

    }

    static final SQLException notSupported() {

//#ifdef JAVA6
        HsqlException e = Error.error(ErrorCode.X_0A000);

        return new SQLFeatureNotSupportedException(e.getMessage(),
                e.getSQLState(), -ErrorCode.X_0A000);

//#else
/*
        return sqlException(Error.error(ErrorCode.X_0A000));
*/
 
View Full Code Here

        if (isClosed()) {
            return;
        }
        closeResultData();

        HsqlException he = null;

        try {

            // fredt - if this is called by Connection.close() then there's no
            // need to free the prepared statements on the server - it is done
View Full Code Here

        int dbIndex = ArrayUtil.find(dbAlias, alias);

        if (dbIndex == -1) {
            if (filepath == null) {
                HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                              "database alias does not exist");

                printError("database alias=" + alias + " does not exist");
                setServerError(e);
View Full Code Here

     * Open and return database index
     */
    final int openDatabase(String alias, String datapath) {

        if (!isRemoteOpen) {
            HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                          "remote open not allowed");

            printError("Remote database open not allowed");
            setServerError(e);

            throw e;
        }

        int i = getFirstEmptyDatabaseIndex();

        if (i < -1) {
            i = closeOldestDatabase();

            if (i < -1) {
                HsqlException e =
                    Error.error(ErrorCode.GENERAL_ERROR,
                                "limit of open databases reached");

                printError("limit of open databases reached");
                setServerError(e);

                throw e;
            }
        }

        HsqlProperties newprops = DatabaseURL.parseURL(datapath, false, false);

        if (newprops == null) {
            HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                          "invalid database path");

            printError("invalid database path");
            setServerError(e);

            throw e;
        }

        String path = newprops.getProperty(DatabaseURL.url_database);
        String type = newprops.getProperty(DatabaseURL.url_connection_type);

        try {
            int dbid = DatabaseManager.getDatabase(type, path, this, newprops);

            dbID[i]             = dbid;
            dbActionSequence[i] = actionSequence;
            dbAlias[i]          = alias;
            dbPath[i]           = path;
            dbType[i]           = type;
            dbProps[i]          = newprops;

            return i;
        } catch (HsqlException e) {
            printError("Database [index=" + i + ", db=" + dbType[i]
                       + dbPath[i] + ", alias=" + dbAlias[i]
                       + "] did not open: " + e.toString());
            setServerError(e);

            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.HsqlException

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.