[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Resolved] (CONFIGURATION-533) Can DatabaseConfiguration turn CLOB values into a Strings befo
From:       "Oliver Heger (JIRA)" <jira () apache ! org>
Date:       2013-04-30 19:46:17
Message-ID: JIRA.12637290.1363385201361.250206.1367351177024 () arcas
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/CONFIGURATION-533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Oliver Heger resolved CONFIGURATION-533.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

Marking issue as resolved; the desired functionality has been implemented. Feel free \
to reopen if further problems are discovered.  
> Can DatabaseConfiguration turn CLOB values into a Strings before returning from \
>                 getProperty(String)?
> ----------------------------------------------------------------------------------------------------
>  
> Key: CONFIGURATION-533
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-533
> Project: Commons Configuration
> Issue Type: Improvement
> Components: Type conversion
> Affects Versions: 1.9
> Environment: Oracle 11gR2 database and JDBC driver
> Reporter: Chris Seieroe
> Assignee: Oliver Heger
> Priority: Minor
> Fix For: 2.0
> 
> 
> The table I'm using for DatabaseConfiguration stores the value in a CLOB column. \
> When the getProperty(String) method searches the table to get the values, the \
> Oracle JDBC driver is returning them back as oracle.sql.CLOB instances. I also use \
> Microsoft SQL Server and its latest JDBC drivers on a similar table where the value \
> is in a TEXT column. I know, I need to switch the column type since it's being \
> deprecated, but that's what it is for now. Anyways, when I get a value from that \
> table, it returns back a String instances. I'm not asking us to support the \
> Oracle-specific class, but perhaps we can add some support for the java.sql.Clob \
> interface. Can we modify the getProperty(String) method to turn those into Strings? \
> When they're java.sql.Clob instances, I cannot use all the nice methods that do \
> type conversion since they don't know what to do with a java.sql.Clob instance. \
> Here is a code sample that might be helpful: private String convertClob(Clob \
> clobValue) { String strValue = null;
> try {
> int length = (int) clobValue.length();
> if (length > 0) {
> strValue = clobValue.getSubString(1, length);
> } else {
> strValue = "";
> }
> } catch (SQLException e) {
> throw new ConversionException(e);
> }
> return strValue;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic