Package org.hsqldb.result

Examples of org.hsqldb.result.ResultLob$LobResultTypes


                    blob = session.createBlob(length);
                    id   = blob.getId();

                    InputStream stream = ((Blob) value).getBinaryStream();
                    ResultLob resultLob =
                        ResultLob.newLobCreateBlobRequest(session.getId(), id,
                            stream, length);

                    session.allocateResultLob(resultLob, null);
                    resultOut.addLobResult(resultLob);
                } else if (value instanceof InputStream) {
                    long length = streamLengths[i];

                    blob = session.createBlob(length);
                    id   = blob.getId();

                    InputStream stream = (InputStream) value;
                    ResultLob resultLob =
                        ResultLob.newLobCreateBlobRequest(session.getId(), id,
                            stream, length);

                    session.allocateResultLob(resultLob, null);
                    resultOut.addLobResult(resultLob);
                }
                parameterValues[i] = blob;
            } else if (parameterTypes[i].typeCode == Types.SQL_CLOB) {
                long       id;
                ClobDataID clob = null;

                if (value instanceof JDBCClobClient) {

                    // check or fix id mismatch
                    clob = ((JDBCClobClient) value).clob;
                    id   = clob.getId();
                } else if (value instanceof Clob) {
                    long   length = ((Clob) value).length();
                    Reader reader = ((Clob) value).getCharacterStream();

                    clob = session.createClob(length);
                    id   = clob.getId();

                    ResultLob resultLob =
                        ResultLob.newLobCreateClobRequest(session.getId(), id,
                            reader, length);

                    session.allocateResultLob(resultLob, null);
                    resultOut.addLobResult(resultLob);
                } else if (value instanceof Reader) {
                    long length = streamLengths[i];

                    clob = session.createClob(length);
                    id   = clob.getId();

                    Reader reader = (Reader) value;
                    ResultLob resultLob =
                        ResultLob.newLobCreateClobRequest(session.getId(), id,
                            reader, length);

                    session.allocateResultLob(resultLob, null);
                    resultOut.addLobResult(resultLob);
View Full Code Here


        return null;
    }

    public byte[] getBytes(SessionInterface session, long pos, int length) {

        ResultLob resultOut = ResultLob.newLobGetBytesRequest(id, pos, length);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw Error.error(resultIn);
        }
View Full Code Here

        return ((ResultLob) resultIn).getByteArray();
    }

    public BlobData getBlob(SessionInterface session, long pos, long length) {

        ResultLob resultOut = ResultLob.newLobGetRequest(id, pos, length);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw Error.error(resultIn);
        }
View Full Code Here

        return false;
    }

    public long length(SessionInterface session) {

        ResultLob resultOut = ResultLob.newLobGetLengthRequest(id);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
        }
View Full Code Here

    }

    public long position(SessionInterface session, byte[] pattern,
                         long start) {

        ResultLob resultOut = ResultLob.newLobGetBytePatternPositionRequest(id,
            pattern, start);
        ResultLob resultIn = (ResultLob) session.execute(resultOut);

        return resultIn.getOffset();
    }
View Full Code Here

            System.arraycopy(bytes, offset, newbytes, 0, len);

            bytes = newbytes;
        }

        ResultLob resultOut = ResultLob.newLobSetBytesRequest(id, pos, bytes);
        Result    resultIn  = (ResultLob) session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
        }
View Full Code Here

    public void setSession(SessionInterface session) {}

    public void truncate(SessionInterface session, long len) {

        ResultLob resultOut = ResultLob.newLobTruncateRequest(id, len);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
        }
View Full Code Here

    }

    public char[] getChars(SessionInterface session, long position,
                           int length) {

        ResultLob resultOut = ResultLob.newLobGetCharsRequest(id, position,
            length);
        Result resultIn = session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
View Full Code Here

        return ((ResultLob) resultIn).getCharArray();
    }

    public long length(SessionInterface session) {

        ResultLob resultOut = ResultLob.newLobGetLengthRequest(id);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
        }
View Full Code Here

    }

    public ClobData getClob(SessionInterface session, long position,
                            long length) {

        ResultLob resultOut = ResultLob.newLobGetRequest(id, position, length);
        Result    resultIn  = session.execute(resultOut);

        if (resultIn.isError()) {
            throw resultIn.getException();
        }
View Full Code Here

TOP

Related Classes of org.hsqldb.result.ResultLob$LobResultTypes

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.