@author Fred Toussi (fredt@users dot sourceforge.net) @version 1.9.0 @since 1.9.0
100101102103104105106107108109110
return new ClobDataID(((ResultLob) resultIn).getLobID()); } public void truncate(SessionInterface session, long len) { ResultLob resultOut = ResultLob.newLobTruncateRequest(id, len); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }
120121122123124125126127128129130
return 0; } public int setString(SessionInterface session, long pos, String str) { ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, str.toCharArray()); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException();
138139140141142143144145146147148
if (!isInLimits(str.length(), offset, len)) { throw Error.error(ErrorCode.X_22001); } ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, str.substring(offset, len).toCharArray()); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException();
160161162163164165166167168169170
char[] newChars = new char[len]; System.arraycopy(chars, offset, newChars, 0, len); ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, chars); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }
173174175176177178179180181182183
} public long position(SessionInterface session, String searchstr, long start) { ResultLob resultOut = ResultLob.newLobGetCharPatternPositionRequest(id, searchstr.toCharArray(), start); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException();
5657585960616263646566
} public char[] getChars(SessionInterface session, long position, int length) { ResultLob resultOut = ResultLob.newLobGetCharsRequest(id, position, length); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException();
7374757677787980818283
if (length > -1) { return length; } ResultLob resultOut = ResultLob.newLobGetLengthRequest(id); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }
9596979899100101102103104105
return new String(chars); } public ClobData duplicate(SessionInterface session) { ResultLob resultOut = ResultLob.newLobDuplicateRequest(id); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }
110111112113114115116117118119120
} public ClobData getClob(SessionInterface session, long position, long length) { ResultLob resultOut = ResultLob.newLobGetRequest(id, position, length); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }
124125126127128129130131132133134
return new ClobDataID(lobID); } public void truncate(SessionInterface session, long len) { ResultLob resultOut = ResultLob.newLobTruncateRequest(id, len); Result resultIn = session.execute(resultOut); if (resultIn.isError()) { throw resultIn.getException(); }