[
https://issues.apache.org/jira/browse/DERBY-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465535
]
Anurag Shekhar commented on DERBY-2247:
---------------------------------------
description of patch
I have added set methods for blob in embedded driver. The set methods are
provided by introducing a new class LOBStreamControl. This class uses a
temporary file if the data size is more than 4k. Random access file is used to
read/write to the file. This class provides methods to use the data as byte
array and streams to read/write data bytes.
new files
java/engine/org/apache/derby/impl/jdbc/LOBStreamControl.java
This class maintains the data bytes once the data is materialized, which can
happen when
1. The blob is smaller than one page in that case there won't be any reference
to store pages in blob class.
2. At the first call to setbytes or when a output stream is retrieved from the
blob. In this case the data will be materialized in LOBStreamControl class.
java/engine/org/apache/derby/impl/jdbc/LOBOutputStream.java
java/engine/org/apache/derby/impl/jdbc/LOBInputStream.java
This two classes operate on LOBStreamControl to read or write bytes.
java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
EmbedBlob class is modified to use LOBStreamControl. current implementation
uses bytes array within the same class, now this is moved to LOBStreamControl.
All read and write method is forwarded to LOBStreamControl if the data is
materialized.
java/shared/org/apache/derby/shared/common/reference/SQLState.java
New sql state is added for closed stream.
java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
added permission to read/write/delete in system's temporary directory
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestBlobSetMethods.java
Test case for embedded blob set methods.
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobStreamTest.java
Test case for blob stream.
java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall
added the tests part of jdbc40 test suite
java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
excluded the test cases from network driver.
> provide set methods for blob in embeded driver
> ----------------------------------------------
>
> Key: DERBY-2247
> URL: https://issues.apache.org/jira/browse/DERBY-2247
> Project: Derby
> Issue Type: Sub-task
> Components: JDBC
> Environment: all
> Reporter: Anurag Shekhar
> Assigned To: Anurag Shekhar
> Priority: Minor
> Attachments: derby-2247.diff
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira