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>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to