Examples of ClobImpl


Examples of org.hibernate.lob.ClobImpl

   * Create a new <tt>Clob</tt>. The returned object will be initially immutable.
   *
   * @param string a <tt>String</tt>
   */
  public static Clob createClob(String string) {
    return new SerializableClob( new ClobImpl( string ) );
  }
View Full Code Here

Examples of org.hibernate.lob.ClobImpl

   *
   * @param reader a character stream
   * @param length the number of characters in the stream
   */
  public static Clob createClob(Reader reader, int length) {
    return new SerializableClob( new ClobImpl( reader, length ) );
  }
View Full Code Here

Examples of org.jpox.store.rdbms.datatype.ClobImpl

                {
                    ((PreparedStatement) ps).setNull(param, getTypeInfo().dataType);
                }
                else
                {
                    ((PreparedStatement) ps).setClob(param, new ClobImpl((String)value));
                }
            }
            catch (SQLException e)
            {
                throw new JPOXDataStoreException(LOCALISER.msg("055001","Object", "" + value, column, e.getMessage()), e);
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

            StreamFactoryReference sfr = new SQLXMLImpl();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof ClobImpl) {
            streams.add(new ReaderInputStream(((ClobImpl)obj).getCharacterStream(), Charset.forName(Streamable.ENCODING)));
            StreamFactoryReference sfr = new ClobImpl();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof BlobImpl) {
            streams.add(((Blob)obj).getBinaryStream());
            StreamFactoryReference sfr = new BlobImpl();
            references.add(sfr);
            return sfr;
          }
        } catch (SQLException e) {
          throw new IOException(e);
        }
      }
      else if (obj instanceof Serializable) {
        return obj;
      }
      else {
      try {
          if (obj instanceof Reader) {
            streams.add(new ReaderInputStream((Reader)obj, Charset.forName(Streamable.ENCODING)));
            StreamFactoryReference sfr = new SerializableReader();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof InputStream) {
            streams.add((InputStream)obj);
            StreamFactoryReference sfr = new SerializableInputStream();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof SQLXML) {
          streams.add(((SQLXML)obj).getBinaryStream());
            StreamFactoryReference sfr = new SQLXMLImpl();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof Clob) {
            streams.add(new ReaderInputStream(((Clob)obj).getCharacterStream(), Charset.forName(Streamable.ENCODING)));
            StreamFactoryReference sfr = new ClobImpl();
            references.add(sfr);
            return sfr;
          } else if (obj instanceof Blob) {
            streams.add(((Blob)obj).getBinaryStream());
            StreamFactoryReference sfr = new BlobImpl();
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

                  //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
                  // Feed the resultant I/O stream into the XSLT processor
          transformer.transform(xmlParam, new StreamResult(writer));
        }
      });
      return new ClobType(new ClobImpl(result.getStreamFactory(), -1));
    } finally {
      Util.closeSource(styleSource);
      Util.closeSource(xmlSource);
    }
    }
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

  public void testLobPeristence() throws Exception{
   
    BufferManagerImpl buffMgr = BufferManagerFactory.createBufferManager();
    FileStore fs = buffMgr.createFileStore("temp");
   
    ClobType clob = new ClobType(new ClobImpl(new InputStreamFactory() {
      @Override
      public InputStream getInputStream() throws IOException {
        return new ReaderInputStream(new StringReader("Clob contents One"),  Charset.forName(Streamable.ENCODING));
      }
     
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

    }
   
    public static Clob toChars(BlobType value, String encoding) {
      Charset cs = getCharset(encoding);
    BlobInputStreamFactory bisf = new BlobInputStreamFactory(value.getReference());
      ClobImpl clob = new ClobImpl(bisf, -1);
      clob.setCharset(cs);
      return new ClobType(clob);
    }
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

    public ClobImpl getVDBResourceAsClob(String resourcePath) {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
    return new ClobImpl(new VirtualFileInputStreamFactory(f), -1);
    }
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

 
  @Test public void testReplaceObject() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectEncoderOutputStream out = new ObjectEncoderOutputStream(new DataOutputStream(baos), 512);
   
    ClobImpl clob = new ClobImpl(new InputStreamFactory() {
      @Override
      public InputStream getInputStream() throws IOException {
        return new ReaderInputStream(new StringReader("Clob contents"),  Charset.forName(Streamable.ENCODING)); //$NON-NLS-1$
      }
     
View Full Code Here

Examples of org.teiid.core.types.ClobImpl

    try {
      if (lob instanceof BlobType) {
        persistedLob = new BlobType(new BlobImpl(isf));
      }
      else if (lob instanceof ClobType) {
        persistedLob = new ClobType(new ClobImpl(isf, ((ClobType)lob).length()));
      }
      else {
        persistedLob = new XMLType(new SQLXMLImpl(isf));
        ((XMLType)persistedLob).setEncoding(((XMLType)lob).getEncoding());
        ((XMLType)persistedLob).setType(((XMLType)lob).getType());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.