1 24 25 package com.mckoi.database.jdbc; 26 27 import java.sql.SQLException ; 28 import java.sql.Clob ; 29 import java.io.StringReader ; 30 import java.io.Reader ; 31 32 37 38 class MClob implements Clob { 39 40 43 private String str; 44 45 48 public MClob(String str) { 49 this.str = str; 50 } 51 52 54 public long length() throws SQLException { 55 return str.length(); 56 } 57 58 public String getSubString(long pos, int length) throws SQLException { 59 int p = (int) (pos - 1); 60 return str.substring(p, p + length); 61 } 62 63 public Reader getCharacterStream() throws SQLException { 64 return new StringReader (str); 65 } 66 67 public java.io.InputStream getAsciiStream() throws SQLException { 68 return new AsciiInputStream(getCharacterStream()); 69 } 70 71 public long position(String searchstr, long start) throws SQLException { 72 throw MSQLException.unsupported(); 73 } 74 75 public long position(Clob searchstr, long start) throws SQLException { 76 throw MSQLException.unsupported(); 77 } 78 79 81 83 public int setString(long pos, String str) throws SQLException { 84 throw MSQLException.unsupported(); 85 } 86 87 public int setString(long pos, String str, int offset, int len) 88 throws SQLException { 89 throw MSQLException.unsupported(); 90 } 91 92 public java.io.OutputStream setAsciiStream(long pos) throws SQLException { 93 throw MSQLException.unsupported(); 94 } 95 96 public java.io.Writer setCharacterStream(long pos) throws SQLException { 97 throw MSQLException.unsupported(); 98 } 99 100 public void truncate(long len) throws SQLException { 101 throw MSQLException.unsupported(); 102 } 103 104 106 } 107 108 | Popular Tags |