1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/*-------------------------------------------------------------------------
*
* Copyright (c) 2004-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Clob.java,v 1.14 2008/01/08 06:56:28 jurka Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.jdbc2;
import org.postgresql.core.BaseConnection;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.sql.Clob;
import java.sql.SQLException;
public abstract class AbstractJdbc2Clob extends AbstractJdbc2BlobClob
{
public AbstractJdbc2Clob(BaseConnection conn, long oid) throws SQLException
{
super(conn, oid);
}
public synchronized InputStream getAsciiStream() throws SQLException
{
return getBinaryStream();
}
public synchronized Reader getCharacterStream() throws SQLException
{
return new InputStreamReader(getBinaryStream());
}
public synchronized String getSubString(long i, int j) throws SQLException
{
assertPosition(i, j);
lo.seek((int)i - 1);
return new String(lo.read(j));
}
/*
* For now, this is not implemented.
*/
public synchronized long position(String pattern, long start) throws SQLException
{
checkFreed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "position(String,long)");
}
/*
* This should be simply passing the byte value of the pattern Blob
*/
public synchronized long position(Clob pattern, long start) throws SQLException
{
checkFreed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "position(Clob,start)");
}
}
|