Consultor Eletrônico



Kbase P186588: PreparedStatement setLong truncates long value when inserting into database
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   26/04/2011
Status: Unverified

SYMPTOM(s):

PreparedStatement setLong truncates long value when inserting into database

999000000000007010L becomes 43883362

Same works fine with OpenEdge version 10.2B04 and Java 6

FACT(s) (Environment):

Code example:
Long value = 999000000000007010L;
stmt.setLong(1, value);

Progress 9.1E04 Service Pack
All Supported Operating Systems

CAUSE:

Product limit with the used Java version.

FIX:

Use setBigDecimal method of PreparedStatement class instead

Example:
long l = 999000000000007010L;
java.math.BigDecimal value = java.math.BigDecimal.valueOf(l);
stmt.setBigDecimal(1, value);