public Clob fromString(String string) { return ClobProxy.generateProxy( string ); }
/** * Generates a {@link Clob} proxy using a character reader of given length. * * @param reader The character reader * @param length The length of the character reader * * @return The generated proxy. */ public static Clob generateProxy(Reader reader, long length) { return (Clob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( reader, length ) ); }
return getLength(); return getUnderlyingStream(); // Reset stream if needed. return getAsciiStream(); return getCharacterStream(); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); return DataHelper.subStream( getCharacterStream(), start-1, length ); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); throw new SQLException( "Length must be great-than-or-equal to zero." ); return getSubString( start-1, length );
/** * Generates a {@link java.sql.Clob} proxy using the string data. * * @param string The data to be wrapped as a {@link java.sql.Clob}. * * @return The generated proxy. */ public static NClob generateProxy(String string) { return (NClob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( string ) ); }
protected CharacterStream getUnderlyingStream() throws SQLException { resetIfNeeded(); return characterStream; }
protected InputStream getAsciiStream() throws SQLException { return new ReaderInputStream( getCharacterStream() ); }
protected Reader getCharacterStream() throws SQLException { return getUnderlyingStream().asReader(); }
/** * Generates a {@link java.sql.NClob} proxy using a character reader of given length. * * @param reader The character reader * @param length The length of the character reader * * @return The generated proxy. */ public static NClob generateProxy(Reader reader, long length) { return (NClob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( reader, length ) ); }
protected CharacterStream getUnderlyingStream() throws SQLException { resetIfNeeded(); return characterStream; }
protected InputStream getAsciiStream() throws SQLException { return new ReaderInputStream( getCharacterStream() ); }
protected Reader getCharacterStream() throws SQLException { return getUnderlyingStream().asReader(); }
return Long.valueOf( getLength() ); return getAsciiStream(); return getCharacterStream(); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); return DataHelper.subStream( getCharacterStream(), start-1, length ); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); throw new SQLException( "Length must be great-than-or-equal to zero." ); return getSubString( start-1, length );
/** * Generates a {@link Clob} proxy using the string data. * * @param string The data to be wrapped as a {@link Clob}. * * @return The generated proxy. */ public static Clob generateProxy(String string) { return (Clob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( string ) ); }
@Override public Clob createClob(String string) { return ClobProxy.generateProxy( string ); }
/** * Generates a {@link java.sql.Clob} proxy using the string data. * * @param string The data to be wrapped as a {@link java.sql.Clob}. * * @return The generated proxy. */ public static NClob generateProxy(String string) { return (NClob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( string ) ); }
protected Reader getCharacterStream() throws SQLException { resetIfNeeded(); return reader; }
return getLength(); return getUnderlyingStream(); // Reset stream if needed. return getAsciiStream(); return getCharacterStream(); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); return LobStreamDataHelper.subStream( getCharacterStream(), start-1, length ); throw new SQLException( "Start position 1-based; must be 1 or more." ); if ( start > getLength() ) { throw new SQLException( "Start position [" + start + "] cannot exceed overall CLOB length [" + getLength() + "]" ); throw new SQLException( "Length must be great-than-or-equal to zero." ); return getSubString( start-1, length );
/** * Generates a {@link Clob} proxy using the string data. * * @param string The data to be wrapped as a {@link Clob}. * * @return The generated proxy. */ public static Clob generateProxy(String string) { return (Clob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( string ) ); }
@Override public Clob createClob(Reader reader, long length) { return ClobProxy.generateProxy( reader, length ); }
/** * Generates a {@link java.sql.NClob} proxy using a character reader of given length. * * @param reader The character reader * @param length The length of the character reader * * @return The generated proxy. */ public static NClob generateProxy(Reader reader, long length) { return (NClob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( reader, length ) ); }