1
package org.postgresql.jdbc2;
4
import org.postgresql.PGConnection;
5
import org.postgresql.largeobject.LargeObject;
6
import org.postgresql.largeobject.LargeObjectManager;
7
import java.io.InputStream;
8
import java.io.InputStreamReader;
11
import java.sql.SQLException;
13
public class AbstractJdbc2Clob
16
private LargeObject lo;
18
public AbstractJdbc2Clob(PGConnection conn, int oid) throws SQLException
21
LargeObjectManager lom = conn.getLargeObjectAPI();
22
this.lo = lom.open(oid);
25
public long length() throws SQLException
30
public InputStream getAsciiStream() throws SQLException
32
return lo.getInputStream();
35
public Reader getCharacterStream() throws SQLException
37
return new InputStreamReader(lo.getInputStream());
40
public String getSubString(long i, int j) throws SQLException
43
return new String(lo.read(j));
47
* For now, this is not implemented.
49
public long position(String pattern, long start) throws SQLException
51
throw org.postgresql.Driver.notImplemented();
55
* This should be simply passing the byte value of the pattern Blob
57
public long position(Clob pattern, long start) throws SQLException
59
throw org.postgresql.Driver.notImplemented();