Statement stm = connection.createStatement();
stm.executeUpdate("CREATE TABLE TEST1(ID BIGINT, ZEIT DECIMAL(8,7))");
stm.executeUpdate("INSERT INTO TEST1 (ID, ZEIT) VALUES (1, 0.000008)");
stm.executeUpdate("INSERT INTO TEST1 (ID, ZEIT) VALUES (2, '0.000008')");
ResultSet result = stm.executeQuery("SELECT * FROM TEST1");
while (result.next()) {
     System.out.println(result.getObject(1) + " = " + result.getObject(2));
}

results in:
1 = 0.0000080
2 = 0.0000080

so I suspect your using an old version of h2 or the retrival of the data is different. This even works with getFloat for me...
1 = 8.0E-6
2 = 8.0E-6

Am 15.01.2012 13:31, schrieb Jochen Schreiber:
Try this:

CREATE TABLE HTS.TEST1(ID BIGINT, ZEIT DECIMAL(8,7))

INSERT INTO HTS.TEST1 (ID, ZEIT) VALUES (1,0.000008);

Then the value in Zeit is 0.00001

On 15 Jan., 13:25, Christoph Läubrich<[email protected]>  wrote:
I'm using exact decimal in a project with this definition:
CREATE TABLE Eintrag (ID BIGINT AUTO_INCREMENT NOT NULL, ZEIT
DECIMAL(4,2), PRIMARY KEY (ID))
and it works fine, where ZEIT are values like:
    2.34
or something, mabe a bug in the statement parser. Have you tried using a
prepared statment and setBigDecimal(new BigDecimal("0.00008"))?

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to