package acspg; import javax.activation.*; import java.sql.*; import java.io.*; import acspg.*; public class CLOB { private String str = null; private String istr = null; private Pg_Query query = null; public CLOB() { this.str = null; } public CLOB(String str) { this.str = str; } public InputStream getAsciiStream() throws SQLException { try { ByteArrayInputStream buf = new ByteArrayInputStream(this.str.getBytes()); return buf; } catch (Exception e) { throw new SQLException("SQL Exception caught: " + e.getMessage()); } } public OutputStream getAsciiOutputStream() throws SQLException { try { ClobOutputStream buf = new ClobOutputStream(this.str,this.istr,this.query); return buf; } catch (IOException e) { throw new SQLException("SQL Exception caught: " + e.getMessage()); } } public int length() { return this.str.length(); } public int getChunkSize() { return 1024; } public void setInsertString(String istr) { this.istr = istr; } public void setQueryObject(Pg_Query q) { this.query = q; } }