1 29 package com.caucho.db.sql; 30 31 import com.caucho.db.store.BlobInputStream; 32 import com.caucho.db.store.Store; 33 import com.caucho.util.L10N; 34 35 import java.io.InputStream ; 36 import java.io.OutputStream ; 37 import java.io.Reader ; 38 import java.io.Writer ; 39 import java.sql.Clob ; 40 import java.sql.SQLException ; 41 42 45 public class ClobImpl implements java.sql.Clob { 46 private static final L10N L = new L10N(ClobImpl.class); 47 48 private Store _store; 49 private byte []_inode = new byte[128]; 50 51 ClobImpl() 52 { 53 } 54 55 void setStore(Store store) 56 { 57 _store = store; 58 } 59 60 byte []getInode() 61 { 62 return _inode; 63 } 64 65 68 public InputStream getAsciiStream() 69 throws SQLException 70 { 71 return new BlobInputStream(_store, _inode, 0); 73 } 74 75 78 public Reader getCharacterStream() 79 throws SQLException 80 { 81 throw new UnsupportedOperationException (); 82 } 83 84 87 public String getSubString(long pos, int length) 88 throws SQLException 89 { 90 throw new UnsupportedOperationException (); 91 } 92 93 96 public long length() 97 throws SQLException 98 { 99 return BlobInputStream.readLong(_inode, 0); 100 } 101 102 105 public long position(Clob pattern, long start) 106 throws SQLException 107 { 108 throw new UnsupportedOperationException (); 109 } 110 111 114 public long position(String pattern, long start) 115 throws SQLException 116 { 117 throw new UnsupportedOperationException (); 118 } 119 120 123 public OutputStream setAsciiStream(long pos) 124 throws SQLException 125 { 126 throw new UnsupportedOperationException (); 127 } 128 129 132 public Writer setCharacterStream(long pos) 133 throws SQLException 134 { 135 throw new UnsupportedOperationException (); 136 } 137 138 141 public int setString(long pos, String string) 142 throws SQLException 143 { 144 throw new UnsupportedOperationException (); 145 } 146 147 150 public int setString(long pos, String string, int offset, int len) 151 throws SQLException 152 { 153 throw new UnsupportedOperationException (); 154 } 155 156 159 public void truncate(long length) 160 throws SQLException 161 { 162 throw new UnsupportedOperationException (); 163 } 164 165 public String toString() 166 { 167 return "ClobImpl[]"; 168 } 169 } 170 | Popular Tags |