1 2 9 10 package org.objectweb.rmijdbc; 11 12 import java.sql.*; 13 import java.io.InputStream ; 14 import java.io.Reader ; 15 import java.rmi.RemoteException ; 16 17 public class RJClob implements java.sql.Clob , java.io.Serializable 18 { 19 20 RJClobInterface rmiClob_; 21 22 public RJClob(RJClobInterface b) { 23 rmiClob_ = b; 24 } 25 26 public Reader getCharacterStream() throws SQLException { 28 try { 29 char[] val = rmiClob_.getCharacterStream(); 30 return RJSerializer.toReader(val); 31 } catch(Exception e) { 32 throw new java.sql.SQLException (e.getMessage()); 33 } 34 } 35 public long length() throws SQLException { 36 try { 37 return rmiClob_.length(); 38 } catch(RemoteException e) { 39 throw new java.sql.SQLException (e.getMessage()); 40 } 41 } 42 43 public String getSubString(long pos, int length) throws SQLException { 44 try { 45 return rmiClob_.getSubString(pos, length); 46 } catch(RemoteException e) { 47 throw new java.sql.SQLException (e.getMessage()); 48 } 49 } 50 51 public InputStream getAsciiStream() throws SQLException { 53 try { 54 byte[] val = rmiClob_.getAsciiStream(); 55 return RJSerializer.toInputStream(val); 56 } catch(Exception e) { 57 throw new java.sql.SQLException (e.getMessage()); 58 } 59 } 60 61 public long position(String searchstr, long start) throws SQLException { 62 try { 63 return rmiClob_.position(searchstr, start); 64 } catch(RemoteException e) { 65 throw new java.sql.SQLException (e.getMessage()); 66 } 67 } 68 69 public long position(Clob searchstr, long start) throws SQLException { 70 try { 71 return rmiClob_.position(searchstr.getSubString(0, (int)searchstr.length()), start); 74 } catch(Exception e) { 75 throw new java.sql.SQLException (e.getMessage()); 76 } 77 } 78 79 public int setString(long pos, String str) 81 throws SQLException 82 { 83 try { 84 return rmiClob_.setString(pos, str); 85 } catch(Exception e) { 86 throw new java.sql.SQLException (e.getMessage()); 87 } 88 } 89 90 public int setString(long pos, String str, int offset, int len) 91 throws SQLException 92 { 93 try { 94 return rmiClob_.setString(pos, str, offset, len); 95 } catch(Exception e) { 96 throw new java.sql.SQLException (e.getMessage()); 97 } 98 } 99 100 101 public java.io.OutputStream setAsciiStream(long pos) 102 throws SQLException 103 { 104 try { 105 return rmiClob_.setAsciiStream(pos); 106 } catch(Exception e) { 107 throw new java.sql.SQLException (e.getMessage()); 108 } 109 } 110 111 public java.io.Writer setCharacterStream(long pos) 112 throws SQLException 113 { 114 try { 115 return rmiClob_.setCharacterStream(pos); 116 } catch(Exception e) { 117 throw new java.sql.SQLException (e.getMessage()); 118 } 119 } 120 121 public void truncate(long len) 122 throws SQLException 123 { 124 try { 125 rmiClob_.truncate(len); 126 } catch(Exception e) { 127 throw new java.sql.SQLException (e.getMessage()); 128 } 129 } 130 131 }; 132 133 | Popular Tags |