Hi Anjana,

Sure will do it.

Thanks,
Madhawa

On Thu, Oct 8, 2015 at 6:05 PM, Anjana Fernando <[email protected]> wrote:

> Hi,
>
> I think this functionality is not exposed from our ndatasource
> RDBMSDataSourceReader implementation. We would have to put a new property
> to set these "DB properties". I think, these must be the properties passed
> into when creating a new connection with this [1]. @Madhawa, shall we
> implement this for a future Kernel release, by adding a new section to put
> these properties in the configuration.
>
> [1]
> http://docs.oracle.com/javase/7/docs/api/java/sql/DriverManager.html#getConnection(java.lang.String,%20java.util.Properties)
>
> Cheers,
> Anjana.
>
> On Thu, Oct 8, 2015 at 3:33 PM, Isuru Perera <[email protected]> wrote:
>
>> Hi,
>>
>> With Carbon Metrics, I need to save some "double" values in the database.
>> Sometimes the Oracle JDBC Driver throws "Underflow" exceptions [1] when
>> trying to set a double to a prepared statement.
>>
>> To solve that issue, I changed the database columns to "BINARY_DOUBLE
>> <https://docs.oracle.com/cd/E11882_01/timesten.112/e21642/types.htm#BABIGDEA>"
>> [2] and I want to set the property "SetFloatAndDoubleUseBinary" to true.
>>
>> I tested this with a standalone app with Tomcat JDBC and it works.
>>
>> import org.apache.tomcat.jdbc.pool.DataSource;
>> import org.apache.tomcat.jdbc.pool.PoolProperties;
>> ...
>>
>> PoolProperties p = new PoolProperties();
>> p.setUrl("jdbc:oracle:thin:@localhost:1521/metrics");
>> p.setDriverClassName("oracle.jdbc.OracleDriver");
>> p.setUsername("USER");
>> p.setPassword("PASSWD");
>> ....
>> DataSource datasource = new DataSource();
>> datasource.setPoolProperties(p);
>>
>>
>> *Properties properties = new
>> Properties();properties.setProperty("SetFloatAndDoubleUseBinary",
>> "true");p.setDbProperties(properties);*
>>
>> I thought there is a way to set these kinds of properties in
>> *-datasources.xml file. However I don't see a way to do that in
>> configuration [3].
>>
>> I don't want to change the double values and I want to save it directly
>> in the database. How do we fix this?
>>
>> Thanks!
>>
>> Best Regards,
>>
>> [1] https://wso2.org/jira/browse/MB-1271
>> [2]
>> https://docs.oracle.com/cd/E11882_01/timesten.112/e21642/types.htm#BABIGDEA
>> [3]
>> https://github.com/wso2/carbon-kernel/blob/v4.4.1/core/org.wso2.carbon.ndatasource.rdbms/src/main/java/org/wso2/carbon/ndatasource/rdbms/RDBMSConfiguration.java
>> --
>> Isuru Perera
>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>> Contact: +IsuruPereraWSO2 <https://www.google.com/+IsuruPereraWSO2/about>
>>
>
>
>
> --
> *Anjana Fernando*
> Senior Technical Lead
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>



-- 
*Madhawa Gunasekara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 719411002 <+94+719411002>
blog: *http://madhawa-gunasekara.blogspot.com
<http://madhawa-gunasekara.blogspot.com>*
linkedin: *http://lk.linkedin.com/in/mgunasekara
<http://lk.linkedin.com/in/mgunasekara>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to