Package org.apache.derby.client.am

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


        if (vcm_length > 0) {
            stringToBeSet = readString(vcm_length, netAgent_.targetTypdef_.getCcsidMbcEncoding());
        }
        int vcs_length = readUnsignedShort();
        if (vcm_length > 0 && vcs_length > 0) {
            agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
                new ClientMessageId(SQLState.NET_VCM_VCS_LENGTHS_INVALID)));
        } else if (vcs_length > 0) {
            stringToBeSet = readString(vcs_length, netAgent_.targetTypdef_.getCcsidSbcEncoding());
        }
View Full Code Here


            return;
        }

        // The server should send NULLDATA
        netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(netAgent_,
                    new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
                    "parseSQLDIAGSTT"));
    }
View Full Code Here

            return;
        }
       
        // The server should send NULLDATA
        netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(netAgent_,
                    new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
                    "parseSQLDIAGCN"));
    }
View Full Code Here

            return;
        }

        // The server should send NULLDATA
        netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(netAgent_,
                    new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
                    "parseSQLDCTOKS"));
    }
View Full Code Here

            return;
        }

        // The server should send NULLDATA
        netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(netAgent_,
                    new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
                    "parseSQLDCXGRP"));
    }
View Full Code Here

        server_ = server;
        port_ = port;
        netConnection_ = netConnection;
        if (server_ == null) {
            throw new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECT_REQUIRED_PROPERTY_NOT_SET),
                "serverName");
        }

        try {
            socket_ = (java.net.Socket) java.security.AccessController.doPrivileged(new OpenSocketAction(server, port));
        } catch (java.security.PrivilegedActionException e) {
            throw new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECT_UNABLE_TO_CONNECT_TO_SERVER),
                new Object[] { e.getException().getClass().getName(), server,
                    Integer.toString(port), e.getException().getMessage() },
                e.getException());
        }

        // Set TCP/IP Socket Properties
        try {
            if (exceptionOpeningSocket_ == null) {
                socket_.setTcpNoDelay(true); // disables nagles algorithm
                socket_.setKeepAlive(true); // PROTOCOL Manual: TCP/IP connection allocation rule #2
                socket_.setSoTimeout(loginTimeout * 1000);
            }
        } catch (java.net.SocketException e) {
            try {
                socket_.close();
            } catch (java.io.IOException doNothing) {
            }
            exceptionOpeningSocket_ = new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECT_SOCKET_EXCEPTION),
                e.getMessage(), e);
        }

        try {
            if (exceptionOpeningSocket_ == null) {
                rawSocketOutputStream_ = socket_.getOutputStream();
                rawSocketInputStream_ = socket_.getInputStream();
            }
        } catch (java.io.IOException e) {
            try {
                socket_.close();
            } catch (java.io.IOException doNothing) {
            }
            exceptionOpeningSocket_ = new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECT_UNABLE_TO_OPEN_SOCKET_STREAM),
                e.getMessage(), e);
        }

        sourceCcsidManager_ = new EbcdicCcsidManager(); // delete these
View Full Code Here

            return;
        }
        try {
            netConnection_.writeDeferredReset();
        } catch (SqlException sqle) {
            DisconnectException de = new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET));
            de.setNextException(sqle);
            throw de;
        }
    }
View Full Code Here

        }
        try {
            netConnection_.readDeferredReset();
            checkForExceptions();
        } catch (SqlException sqle) {
            DisconnectException de = new DisconnectException(this,
                new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET));
            de.setNextException(sqle);
            throw de;
        }
    }
View Full Code Here

        } while ((totalBytesRead < minimumBytesNeeded) && (actualBytesRead != -1));

        if (actualBytesRead == -1) {
            if (totalBytesRead < minimumBytesNeeded) {
                netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                    new DisconnectException(netAgent_,
                        new ClientMessageId(SQLState.NET_INSUFFICIENT_DATA),
                        new Integer(minimumBytesNeeded),
                        new Integer(totalBytesRead)));
            }
        }
View Full Code Here

        try {
            s = new String(buffer_, pos_, length, encoding);
        } catch (java.io.UnsupportedEncodingException e) {
            agent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(agent_,
                    new ClientMessageId(SQLState.NET_ENCODING_NOT_SUPPORTED),
                    e));
        }

        pos_ += length;
View Full Code Here

TOP

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

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.