How to deal with Double values from JDBC Adapter to Document

Hi,

I have to deal with Double values returned by Oracle Procs (from JDBC Adapter) (NUMBER (5, 2) for example).
I’m trying to map the result to a “Document->amount” field (amount is a double type)

In the ResultSet of my Adapter I’m trying many ways :
1/ the default Jdbc Type is “DOUBLE” and Output Type is “Object”.
If I debug execute, I’m obtaining values like 0.53 ("." separator) in output, but mapping the value to the Document gives the amount field empty (Document exists but not the field).

2/ If I keep the Jdbc Type to “DOUBLE” and change Output Type to “Double”.
If I debug execute, I’m obtaining values like 0,53 ("," separator) in ouput, but mapping the value to the Document gives the amount field empty too.

3/ If I keep the Jdbc Type to “DOUBLE” and change Output Type to “String”.
If I debug execute, I’m obtaining values like “.53” ("." separator without zero), and mapping the value to the Document gives an apparent valid amount field = “.53”.

Could you please help me to choose the best way to map my double field Document please ?

(2) is the solution that seems logical to me (keeping the native type) but have I to convert it before, to map it then to my new Document ?

Regards

Hi Cedric,

please try with field Output Type “java.math.BigDecimal”.

Regards,
Holger

Hi Holger,

For the DOUBLE JDBC Type, in the Adapter I have only these 3 Output Types :

  • java.lang.String
  • java.lang.Double
  • java.lang.Object

Regards

Hi Cedric,

then it should be either String or Double.

It might be neccessary to re-format the result using Built-In Services.

There might be an issue with your localization settings (i.e. which char to use as a fractional delimiter).

Regards,
Holger