db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2073) Inserting BigDecimal value in PreparedStatement into double column loses fractional digits
Date Mon, 13 Nov 2006 15:42:39 GMT
    [ http://issues.apache.org/jira/browse/DERBY-2073?page=comments#action_12449403 ] 
            
Daniel John Debrunner commented on DERBY-2073:
----------------------------------------------

Just an FYI on some code in the repro case (thanks for that).

DriverManager.registerDriver((Driver) Class.forName(JDBC_DERBY_DRIVER).newInstance());

There is no need for applications to call DriverManager.registerDriver, that method is intended
for a driver to register itself.
Calling this method from an application can cause unexpected failures.

To load the Derby driver, the correct code is simply:

Class.forName(JDBC_DERBY_DRIVER).newInstance();


> Inserting BigDecimal value in PreparedStatement into double column loses fractional digits
> ------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2073
>                 URL: http://issues.apache.org/jira/browse/DERBY-2073
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.1.2.1
>         Environment: windows xp
>            Reporter: Lukasz P
>         Attachments: BigDecimalProblemTester.java
>
>
> Create table with column of type double.
> Create a prepared statement which inserts value to this column.
> use preparedStatement#setBigDecimal method of the statement to set value of the column.
> Execution of such statement succeeds, but actual value in db has no fractional digits.
> You can use attached test class to reproduce this problem

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message