Package org.hsqldb.types

Examples of org.hsqldb.types.BlobDataID


    protected BlobData readBlob() throws IOException {

        long id = super.readLong();

        return new BlobDataID(id);
    }
View Full Code Here


            return null;
        }

        long id = ((Number) value).longValue();

        return new BlobDataID(id);
    }
View Full Code Here

            return null;
        }

        long id = Long.parseLong(s);

        return new BlobDataID(id);
    }
View Full Code Here

            if (data == null) {
                return null;
            }

            BlobData blob = new BlobDataID(lobID);

            return blob;
        } finally {
            writeLock.unlock();
        }
View Full Code Here

                continue;
            }

            if (parameterTypes[i].typeCode == Types.SQL_BLOB) {
                long       id;
                BlobDataID blob = null;

                if (value instanceof JDBCBlobClient) {

                    // check or fix id mismatch
                    blob = ((JDBCBlobClient) value).blob;
                    id   = blob.getId();
                } else if (value instanceof Blob) {
                    long length = ((Blob) value).length();

                    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];

                    long createLength = length > 0 ? length : 0;

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

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

            throw Error.error(ErrorCode.X_0F502);
        }

        sessionData.registerNewLob(lobID);

        return new BlobDataID(lobID);
    }
View Full Code Here

        checkColumn(columnIndex);

        Type sourceType = resultMetaData.columnTypes[columnIndex - 1];

        if (sourceType.typeCode == Types.SQL_BLOB) {
            BlobDataID x = (BlobDataID) getColumnInType(columnIndex,
                sourceType);

            if (x == null) {
                return null;
            }

            long length = x.length(session);

            if (length > Integer.MAX_VALUE) {
                Util.throwError(Error.error(ErrorCode.X_42561));
            }

            return x.getBytes(session, 0, (int) length);
        }

        Object x = getColumnInType(columnIndex, Type.SQL_VARBINARY);

        if (x == null) {
View Full Code Here

                continue;
            }

            if (parameterTypes[i].typeCode == Types.SQL_BLOB) {
                long       id;
                BlobDataID blob = null;

                if (value instanceof JDBCBlobClient) {

                    // check or fix id mismatch
                    blob = ((JDBCBlobClient) value).blob;
                    id   = blob.getId();
                } else if (value instanceof Blob) {
                    long length = ((Blob) value).length();

                    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);
View Full Code Here

        return lobIDSequence--;
    }

    public BlobDataID createBlob(long length) {

        BlobDataID blob = new BlobDataID(getLobId());

        return blob;
    }
View Full Code Here

            throw Error.error(ErrorCode.X_0F502);
        }

        sessionData.addToCreatedLobs(lobID);

        return new BlobDataID(lobID);
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.types.BlobDataID

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.