db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5505) BLOB and CLOB Reference Manual topics could use some fixes
Date Mon, 16 Apr 2012 09:06:22 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254602#comment-13254602

Knut Anders Hatlen commented on DERBY-5505:

Looks good to me.

Perhaps close the result sets and statements too for good measure?

Some suggestions that would make the code examples a little more compact, feel free to disagree/ignore:

- If the outer try/catch is removed, and the main method is declared to throw Exception, we
save one indentation level.

- The LOB columns in the examples don't need to be declared with an explicit maximum length.
Then we could also remove the comment that says we should really have checked the length of
the file.

- The examples could use the setBinaryStream()/setAsciiStream() methods that don't take a
length argument, so that we don't need to fetch the length from the File object. In fact,
then we wouldn't need a File object at all, and could just create the FileInputStream directly
with new FileInputStream("seeds.jpg").

(To the latter suggestion it might be objected that it would introduce a dependency on JDBC
4.0 and therefore wouldn't work on all supported platforms. I think that would be fine, though.
And in any case the patch already makes other changes that would make the examples dependent
on JDBC 4.0, like removing the explicit loading of the driver, and not casting the length
argument to an int when calling setAsciiStream().)

Another thought: Would it make sense to make the examples code fragments instead of full Java
classes? Then we wouldn't need to waste space on boilerplate like class declarations, error
handling and shutting down the database. They take a fairly big part of the examples, and
may take away the focus from the things we really want to demonstrate.
> BLOB and CLOB Reference Manual topics could use some fixes
> ----------------------------------------------------------
>                 Key: DERBY-5505
>                 URL: https://issues.apache.org/jira/browse/DERBY-5505
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions:
>            Reporter: Kim Haase
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-5505.diff, DERBY-5505.stat, DERBY-5505.zip, blobex.java, blobex.java,
clobex.java, clobex.java, create.sql, fence.jpg, greentea.jpg, seeds.jpg
> The Reference Manual documentation on BLOBs and CLOBs has some gaps that I would like
to fill as a result of my efforts to insert a BLOB into a table column. This should affect
the following topics:
> CAST function (rrefsqlj33562.dita)
> CLOB data type (rrefclob.dita)
> BLOB data type (rrefblob.dita)
> A comment will provide further details.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message