Definition should be:

DECIMAL(8,7) (8 digits, scale 7)

Beside this, you should use getBigDecimal instead of floats which would result 
in rounding errors.



Am 15.01.2012 12:35, schrieb Jochen Schreiber:
Hello everybody,

i have such values: 0.0000008 etc. They have all the same length etc.

If i insert this in the database they will not be in the database and
i think it is because of the wrong datatype of the field where they
would be inserted.

I have tested DECIMAL(8,8) and NUMBER(15,8) etc. but a half of the
values with the format above will not be inserted and i don't know
how.

Another problem is then that if i read it out with java and a
ResultSet (see below) i gained crazy outputs:

JavaCode:

rs = session.connection().createStatement().executeQuery(sql);
while (rs.next()){
  Float bl = rs.getFloat("concentration");
  System.out.println(bl + ": " + rs.getInt("protocol_id"));
}

Output:

0.0000035000: 33
2.000E-7: 132
0.0000047000: 132
0.0000010000: 132
0.0000056000: 132
0.0000013000: 431
0.0000069000: 431
2.000E-7: 431
0.0000059000: 431
9.000E-7: 8
0.0000046000: 8
2.000E-7: 8
0.0000039000: 8
2.000E-7: 339
9.000E-7: 339
0.0000048000: 339
0.0000040000: 339
0.0000010000: 352
0.0000051000: 352
2.000E-7: 352
0.0000043000: 352
0.0000010000: 58
0.0000051000: 58
2.000E-7: 58
0.0000043000: 58
0E-10: 370
3.000E-7: 405
0.0000015000: 405
0.0000066000: 405
0.0000078000: 405
0.0000075000: 449
0.0000089000: 450
0.0000075000: 450
0.0000089000: 449
0.0000018000: 449
3.600E-7: 450

But what is wrong? I don't see it

Greetz

Jochen Schreiber


--
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