Package org.apache.derby.client.am

Examples of org.apache.derby.client.am.SqlException


        // standard constants from XAException.
        int rc = callInfo.xaRetVal_;

        if (rc != XAResource.XA_OK) { // error was detected
            // create an SqlException to report this error within
            SqlException accumSql = new SqlException(conn_.netAgent_.logWriter_,
                new ClientMessageId(SQLState.NET_XARETVAL_ERROR),
                getXAFuncStr(callInfo.xaFunction_),
                getXAExceptionText(rc),
                org.apache.derby.client.am.SqlCode.queuedXAError);
            exceptionsOnXA = org.apache.derby.client.am.Utils.accumulateSQLException
View Full Code Here


                                   throws SQLException {
        try {
            checkForClosedResultSet();
            return interfaces.cast(this);
        } catch (ClassCastException cce) {
            throw new SqlException(null,
                new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
                interfaces).getSQLException();
        } catch (SqlException se) {
            throw se.getSQLException();
        }
View Full Code Here

        }
        popCollectionStack();
        checkRequiredObjects(svrcodReceived, rdbnamReceived);

        netAgent_.setSvrcod(svrcod);
        netAgent_.accumulateReadException(new SqlException(agent_.logWriter_,
            new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
            msgutil_.getTextMessage(MessageId.CONN_USER_NOT_AUTHORIZED_TO_DB)));
    }
View Full Code Here

    void doValnsprmSemantics(int codePoint, String value) throws DisconnectException {

        // special case the FDODTA codepoint not to disconnect.
        if (codePoint == CodePoint.FDODTA) {
            agent_.accumulateReadException(new SqlException(agent_.logWriter_,
                new ClientMessageId(SQLState.DRDA_DDM_PARAMVAL_NOT_SUPPORTED),
                Integer.toHexString(codePoint)));
            return;
        }
View Full Code Here

                    NetConfiguration.PKG_IDENTIFIER_FIXED_LEN)// minimum length of RDBNAM
        } else {
            if (rdbnamLength <= NetConfiguration.PKG_IDENTIFIER_MAX_LEN) {
                writeScalarString(CodePoint.RDBNAM, rdbnam);
            } else {
                throw new SqlException(netAgent_.logWriter_,
                    new ClientMessageId(SQLState.NET_DBNAME_TOO_LONG), rdbnam);
            }
            //"at SQLAM level " + netAgent_.targetSqlam_);
        }
    }
View Full Code Here

        }
    }

    private void buildSECTKN(byte[] sectkn) throws SqlException {
        if (sectkn.length > NetConfiguration.SECTKN_MAXSIZE) {
            throw new SqlException(netAgent_.logWriter_,
                new ClientMessageId(SQLState.NET_SECTKN_TOO_LONG));
        }
        writeScalarBytes(CodePoint.SECTKN, sectkn);
    }
View Full Code Here

    }

    private void buildUSRID(String usrid) throws SqlException {
        int usridLength = usrid.length();
        if ((usridLength == 0) || (usridLength > NetConfiguration.USRID_MAXSIZE)) {
            throw new SqlException(netAgent_.logWriter_,
                new ClientMessageId(SQLState.NET_USERID_TOO_LONG));
        }

        writeScalarString(CodePoint.USRID, usrid);
    }
View Full Code Here

    }

    private void buildPASSWORD(String password) throws SqlException {
        int passwordLength = password.length();
        if ((passwordLength == 0) || (passwordLength > NetConfiguration.PASSWORD_MAXSIZE)) {
            throw new SqlException(netAgent_.logWriter_,
                new ClientMessageId(SQLState.NET_PASSWORD_TOO_LONG));
        }
        if (netAgent_.logWriter_ != null) {
            // remember the position of password in order to
            // mask it out in trace (see Request.sendBytes()).
View Full Code Here

    protected void checkResetPreconditions(org.apache.derby.client.am.LogWriter logWriter,
                                           String user,
                                           String password,
                                           ClientBaseDataSource ds) throws SqlException {
        if (inUnitOfWork_) {
            throw new SqlException(logWriter,
                new ClientMessageId(SQLState.NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK));
        }
    }
View Full Code Here

                checkUserPassword(user_, password);
                flowUSRSSBPWDconnect(password);
                break;

            default:
                throw new SqlException(agent_.logWriter_,
                    new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED),
                    new Integer(securityMechanism));
            }
        } catch (java.lang.Throwable e) { // if *anything* goes wrong, make sure the connection is destroyed
            // always mark the connection closed in case of an error.
            // This prevents attempts to use this closed connection
            // to retrieve error message text if an error SQLCA
            // is returned in one of the connect flows.
            open_ = false;
            // logWriter may be closed in agent_.close(),
            // so SqlException needs to be created before that
            // but to be thrown after.
            SqlException exceptionToBeThrown;
            if (e instanceof SqlException) // rethrow original exception if it's an SqlException
            {
                exceptionToBeThrown = (SqlException) e;
            } else // any other exceptions will be wrapped by an SqlException first
            {
                exceptionToBeThrown = new SqlException(agent_.logWriter_,
                    new ClientMessageId(SQLState.JAVA_EXCEPTION),
                    e.getClass().getName(), e.getMessage(), e);
            }

            try {
View Full Code Here

TOP

Related Classes of org.apache.derby.client.am.SqlException

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.