Connection parameter and
all calls will be made on that connection.
The class makes sure that each procedure call is only prepared once
per instance. Hence, it will keep references to
CallableStatement objects for procedures that have
been called through this instance. This makes it possible to
prepare each procedure call only once per Connection.
Since LOBs can not be parameters to stored procedures, the framework should make sure that calls involving a byte[] or String that does not fit in a VARCHAR (FOR BIT DATA), are split into several calls each operating on a fragment of the LOB.
| Modifier and Type | Field and Description |
|---|---|
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private ClientCallableStatement | |
| private final ClientConnection | connection
The connection to be used when calling the stored procedures. |
| private static final int | |
| private boolean | |
| private static final int | VARCHAR_MAXWIDTH
Max size of byte[] and String parameters to procedures |
| Access | Constructor and Description |
|---|---|
| pack-priv | CallableLocatorProcedures(ClientConnection
the connection to be used to prepare calls. conn)Create an instance to be used for calling locator-based stored procedures. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | Returns: locator that identifies the created BLOB.Allocates an empty BLOB on server and returns its locator. |
| pack-priv byte[] | Returns: a byte array containing up toforLength consecutive
bytes from the BLOB value designated by
sourceLocator, starting with the byte at position
fromPositionlocator that identifies the Blob to operate on sourceLocator, long the ordinal position of the first byte in the
fromPosition, int BLOB value to be extracted; the first byte is at
position 1the number of consecutive bytes to be copied; the value
for length must be 0 or greater. Specifying a length that goes
beyond the end of the BLOB (i.e., forLength)fromPosition + forLength
> blob.length()), will result in an error.Retrieves all or part of the |
| pack-priv long | Returns: length of theBLOB in byteslocator that identifies the BLOB sourceLocator)Returns the number of bytes in the |
| pack-priv long | Returns: the position at which the pattern appears, else -1locator that identifies the BLOB to be searched. locator, byte[] the byte array for which to search searchLiteral, long the position at which to begin searching; the
first position is 1 fromPosition)Retrieves the byte position at which the specified byte array
|
| private long | Returns: the position at which the pattern appears, else -1locator that identifies the BLOB to be searched. locator, long the position at which to begin searching; the
first position is 1 fromPosition, byte[] the byte array for which to search searchLiteral, int the offset into the array offset, int searchLiteral at
which the pattern to search for startsthe number of bytes from the array of bytes
length)searchLiteral to use for the pattern to search
for. It is assumed that this length is smaller than the maximum
size of a VARCHAR FOR BIT DATA column. Otherwise, an exception
will be thrown.Retrieves the byte position at which the specified part of the byte
array |
| pack-priv long | Returns: the position at which the pattern begins, else -1locator that identifies the BLOB to be searched. locator, int locator designating the BLOB value for which to
search searchLocator, long the position in the BLOB value
at which to begin searching; the first position is 1 fromPosition)Retrieves the byte position in the BLOB value designated by this
|
| pack-priv void | blobReleaseLocator(int
locator that designates the BLOB to be released. locator)This method frees the BLOB and releases the resources that it holds. |
| pack-priv void | blobSetBytes(int
locator that identifies the Blob to operated on sourceLocator, long the position in the fromPosition, int BLOB value at which
to start writing; the first position is 1the number of bytes to be written to the
forLength, byte[] BLOB value from the array of bytes
bytes. Specifying a length that goes beyond the end
of the BLOB (i.e., fromPosition + forLength >
blob.length(), will result in an error.the array of bytes to be written bytes)Writes all or part of the given |
| pack-priv void | blobTruncate(int
locator identifying the Blob to be truncated sourceLocator, long the length, in bytes, to which the length)BLOB value
should be truncatedTruncates the |
| pack-priv int | Returns: locator that identifies the created CLOB.Allocates an empty CLOB on server and returns its locator. |
| pack-priv long | Returns: length of theCLOB in characterslocator that identifies the CLOB sourceLocator)Returns the number of character in the |
| pack-priv long | Returns: the position at which the pattern begins, else -1locator that identifies the CLOB to be searched. locator, int locator designating the CLOB value for which to
search searchLocator, long the position in the CLOB value
at which to begin searching; the first position is 1 fromPosition)Retrieves the character position in the CLOB value designated by this
|
| pack-priv long | Returns: the position at which the pattern appears, else -1locator that identifies the CLOB to be searched. locator, String the substring for which to search searchLiteral, long the position at which to begin searching; the
first position is 1 fromPosition)Retrieves the character position at which the specified substring
|
| private long | Returns: the position at which the pattern appears, else -1locator that identifies the CLOB to be searched. locator, long the position at which to begin searching; the
first position is 1 fromPosition, String the substring for which to search searchLiteral, int the offset into the string offset, int searchLiteral at
which the pattern to search for startsthe number of characters from the string
length)searchLiteral to use for the pattern to search
for. It is assumed that this length is smaller than the maximum
size of a VARCHAR column. Otherwise, an exception will be
thrown.Retrieves the character position at which the specified part of the
substring |
| pack-priv String | Returns: a string containing up toforLength consecutive
characters from the CLOB value designated by
sourceLocator, starting with the character at
position fromPositionlocator that identifies the CLOB to operate on sourceLocator, long the ordinal position of the first character in the
fromPosition, int CLOB value to be extracted; the first character is
at position 1the number of consecutive characters to be copied; the
value for length must be 0 or greater. Specifying a length that
goes beyond the end of the CLOB (i.e., forLength)fromPosition +
forLength > clob.length(), will result in an error.Retrieves all or part of the |
| pack-priv void | clobReleaseLocator(int
locator that designates the CLOB to be released. locator)This method frees the CLOB and releases the resources that it holds. |
| pack-priv void | clobSetString(int
locator that identifies the CLOB to operated on sourceLocator, long the position in the fromPosition, int CLOB value at which
to start writing; the first position is 1the number of characters to be written to the
forLength, String CLOB value from the string string.
Specifying a length that goes beyond the end of the CLOB (i.e.,
fromPosition + forLength > clob.length(), will
result in an error.the string to be written string)Writes all or part of the given |
| pack-priv void | clobTruncate(int
locator identifying the CLOB to be truncated sourceLocator, long the length, in characters, to which the length)CLOB
value should be truncatedTruncates the |
| private SqlException | Returns: Ifsqle indicates that locator was
invalid, an SqlException with SQL state
LOB_OBJECT_INVALID. Otherwise, the
incoming exception is returned.Exception to be checked sqle)If the given exception indicates that locator was not valid, we
assume the locator has been garbage-collected due to
transaction commit, and wrap the exception in an exception with
SQL state |
| blobCreateLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement blobCreateLocatorCall | |
| blobGetBytesCall | back to summary |
|---|---|
| private ClientCallableStatement blobGetBytesCall | |
| blobGetLengthCall | back to summary |
|---|---|
| private ClientCallableStatement blobGetLengthCall | |
| blobGetPositionFromBytesCall | back to summary |
|---|---|
| private ClientCallableStatement blobGetPositionFromBytesCall | |
| blobGetPositionFromLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement blobGetPositionFromLocatorCall | |
| blobReleaseLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement blobReleaseLocatorCall | |
| blobSetBytesCall | back to summary |
|---|---|
| private ClientCallableStatement blobSetBytesCall | |
| blobTruncateCall | back to summary |
|---|---|
| private ClientCallableStatement blobTruncateCall | |
| clobCreateLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement clobCreateLocatorCall | |
| clobGetLengthCall | back to summary |
|---|---|
| private ClientCallableStatement clobGetLengthCall | |
| clobGetPositionFromLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement clobGetPositionFromLocatorCall | |
| clobGetPositionFromStringCall | back to summary |
|---|---|
| private ClientCallableStatement clobGetPositionFromStringCall | |
| clobGetSubStringCall | back to summary |
|---|---|
| private ClientCallableStatement clobGetSubStringCall | |
| clobReleaseLocatorCall | back to summary |
|---|---|
| private ClientCallableStatement clobReleaseLocatorCall | |
| clobSetStringCall | back to summary |
|---|---|
| private ClientCallableStatement clobSetStringCall | |
| clobTruncateCall | back to summary |
|---|---|
| private ClientCallableStatement clobTruncateCall | |
| connection | back to summary |
|---|---|
| private final ClientConnection connection The connection to be used when calling the stored procedures. | |
| INVALID_LOCATOR | back to summary |
|---|---|
| private static final int INVALID_LOCATOR | |
| isLocatorSupportAvailable | back to summary |
|---|---|
| private boolean isLocatorSupportAvailable | |
| VARCHAR_MAXWIDTH | back to summary |
|---|---|
| private static final int VARCHAR_MAXWIDTH Max size of byte[] and String parameters to procedures | |
| CallableLocatorProcedures | back to summary |
|---|---|
| pack-priv CallableLocatorProcedures(ClientConnection conn) Create an instance to be used for calling locator-based stored procedures.
| |
| blobCreateLocator | back to summary |
|---|---|
| pack-priv int blobCreateLocator() throws SqlException Allocates an empty BLOB on server and returns its locator. Any subsequent operations on this BLOB value will be stored in temporary space on the server.
| |
| blobGetBytes | back to summary |
|---|---|
| pack-priv byte[] blobGetBytes(int sourceLocator, long fromPosition, int forLength) throws SqlException Retrieves all or part of the
If
| |
| blobGetLength | back to summary |
|---|---|
| pack-priv long blobGetLength(int sourceLocator) throws SqlException Returns the number of bytes in the
| |
| blobGetPositionFromBytes | back to summary |
|---|---|
| pack-priv long blobGetPositionFromBytes(int locator, byte[] searchLiteral, long fromPosition) throws SqlException Retrieves the byte position at which the specified byte array
If
| |
| blobGetPositionFromBytes | back to summary |
|---|---|
| private long blobGetPositionFromBytes(int locator, long fromPosition, byte[] searchLiteral, int offset, int length) throws SqlException Retrieves the byte position at which the specified part of the byte
array This is a helper function used by blobGetPositionFromBytes(int, byte[], long) for each call to the BLOBGETPOSITIONFROMBYTES procedure.
| |
| blobGetPositionFromLocator | back to summary |
|---|---|
| pack-priv long blobGetPositionFromLocator(int locator, int searchLocator, long fromPosition) throws SqlException Retrieves the byte position in the BLOB value designated by this
| |
| blobReleaseLocator | back to summary |
|---|---|
| pack-priv void blobReleaseLocator(int locator) throws SqlException This method frees the BLOB and releases the resources that it holds. (E.g., temporary space used to store this BLOB on the server.)
| |
| blobSetBytes | back to summary |
|---|---|
| pack-priv void blobSetBytes(int sourceLocator, long fromPosition, int forLength, byte[] bytes) throws SqlException Writes all or part of the given
If
| |
| blobTruncate | back to summary |
|---|---|
| pack-priv void blobTruncate(int sourceLocator, long length) throws SqlException Truncates the Note If the value specified for
| |
| clobCreateLocator | back to summary |
|---|---|
| pack-priv int clobCreateLocator() throws SqlException Allocates an empty CLOB on server and returns its locator. Any subsequent operations on this CLOB value will be stored in temporary space on the server.
| |
| clobGetLength | back to summary |
|---|---|
| pack-priv long clobGetLength(int sourceLocator) throws SqlException Returns the number of character in the
| |
| clobGetPositionFromLocator | back to summary |
|---|---|
| pack-priv long clobGetPositionFromLocator(int locator, int searchLocator, long fromPosition) throws SqlException Retrieves the character position in the CLOB value designated by this
| |
| clobGetPositionFromString | back to summary |
|---|---|
| pack-priv long clobGetPositionFromString(int locator, String searchLiteral, long fromPosition) throws SqlException Retrieves the character position at which the specified substring
If
| |
| clobGetPositionFromString | back to summary |
|---|---|
| private long clobGetPositionFromString(int locator, long fromPosition, String searchLiteral, int offset, int length) throws SqlException Retrieves the character position at which the specified part of the
substring This is a helper function used by clobGetPositionFromString(int, String, long) for each call to the CLOBGETPOSITIONFROMSTRING procedure.
| |
| clobGetSubString | back to summary |
|---|---|
| pack-priv String clobGetSubString(int sourceLocator, long fromPosition, int forLength) throws SqlException Retrieves all or part of the
If
| |
| clobReleaseLocator | back to summary |
|---|---|
| pack-priv void clobReleaseLocator(int locator) throws SqlException This method frees the CLOB and releases the resources that it holds. (E.g., temporary space used to store this CLOB on the server.)
| |
| clobSetString | back to summary |
|---|---|
| pack-priv void clobSetString(int sourceLocator, long fromPosition, int forLength, String string) throws SqlException Writes all or part of the given
If
| |
| clobTruncate | back to summary |
|---|---|
| pack-priv void clobTruncate(int sourceLocator, long length) throws SqlException Truncates the Note If the value specified for
| |
| handleInvalidLocator | back to summary |
|---|---|
| private SqlException handleInvalidLocator(SqlException sqle) If the given exception indicates that locator was not valid, we
assume the locator has been garbage-collected due to
transaction commit, and wrap the exception in an exception with
SQL state
| |