Package fi.evident.dalesbred.lob

Examples of fi.evident.dalesbred.lob.ReaderWithSize


    }

    private static void bindReader(@NotNull PreparedStatement ps, int index, @NotNull Reader reader) throws SQLException {
        // The structure followed bindInputStream, see the comments there.
        if (reader instanceof ReaderWithSize) {
            ReaderWithSize readerWithSize = (ReaderWithSize) reader;
            long size = readerWithSize.getSize();
            if (size <= Integer.MAX_VALUE)
                ps.setCharacterStream(index, readerWithSize, (int) size);
            else
                ps.setCharacterStream(index, readerWithSize, size);
        } else {
View Full Code Here


    public void streamReaderToDatabaseText() throws Exception {
        db.update("drop table if exists text_test");
        db.update("create temporary table text_test (id int, text_data text)");

        String originalData = "foo";
        db.update("insert into text_test values (1, ?)", new ReaderWithSize(new StringReader(originalData), originalData.length()));

        String data = db.findUnique(String.class, "select text_data from text_test where id=1");
        assertThat(data, is(originalData));
    }
View Full Code Here

TOP

Related Classes of fi.evident.dalesbred.lob.ReaderWithSize

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.