Package org.nutz.dao.util.blob

Examples of org.nutz.dao.util.blob.SimpleClob


  }

  public Object get(ResultSet rs, String colName) throws SQLException {
    File f = this.createTempFile();
    Files.write(f, rs.getClob(colName).getAsciiStream());
    return new SimpleClob(f);
  }
View Full Code Here


    public void test_clob() throws IOException, SQLException {
        dao.create(BinObject.class, true);
        BinObject bin = new BinObject();
        File f = File.createTempFile("clob", "data");
        Files.write(f, "中文");
        bin.setMyClob(new SimpleClob(f));
        dao.insert(bin);
       
        bin = dao.fetch(BinObject.class);
        String str = Lang.readAll(bin.getMyClob().getCharacterStream());
        assertEquals("中文", str);
View Full Code Here

        File f = this.createTempFile();
        Clob clob = rs.getClob(colName);
        if (clob == null)
            return null;
        Streams.writeAndClose(Streams.fileOutw(f), clob.getCharacterStream());
        return new SimpleClob(f);
    }
View Full Code Here

    public void test_clob() throws IOException, SQLException {
        dao.create(BinObject.class, true);
        BinObject bin = new BinObject();
        File f = File.createTempFile("clob", "data");
        Files.write(f, "中文");
        bin.setMyClob(new SimpleClob(f));
        dao.insert(bin);
       
        bin = dao.fetch(BinObject.class);
        String str = Lang.readAll(bin.getMyClob().getCharacterStream());
        assertEquals("中文", str);
View Full Code Here

TOP

Related Classes of org.nutz.dao.util.blob.SimpleClob

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.