Re: JDBC: Losing precision when mapping doubles from Java
Hello, I'm losing precision when I send a double to a mysql database from a Java program trough JDBC. Code: stmt.setDouble(i+3,((Double)value).doubleValue()); Ok, the problem was solved after I updated my MM.MySQL driver to the newest version. Here you can get it: http://www.thenetsquad.com/services/jdbcsupport.html Roland - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC: Losing precision when mapping doubles from Java
Hi, Document and License is included in gweMysqlJDBC_extra3.zip. It is Free. Thanks. P.S. I have sent e-mail to 'www.gwe.co.uk' admin 1 year ago. But They have not replyed me. ;-) Roland wrote: Hi, Roland Try my JDBC Driver. http://www.t3-jpn.com/jdbc/jdbcmysql.html http://www.t3-jpn.com/jdbc/download/gweMysqlJDBC_extra3.zip Thanks. Hello, thanks for the quick answer. Your page has a link to: http://www.gwe.co.uk/ which is not working. Is there some information in english? Sorry, but I can't read japanese :). I have downloaded your driver. And will try to test it ASAP(as soon as possible) -- TAKAHASHI, Tomohiro - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
JDBC: Losing precision when mapping doubles from Java
Hello, I'm losing precision when I send a double to a mysql database from a Java program trough JDBC. Code: stmt.setDouble(i+3,((Double)value).doubleValue()); I use a prepared statement. Now, if I print out the double in java before sending it to the MySql database this is what it looks like: 1277.00143924408 (11 decimal digits) When I look in the database, this is what the value looks like: 1277.00143924 (8 decimal digits) The type of the column is double(without any precision or digits specification). Now the big question is: what happened to the last 3 decimal digits? Or is this just a display problem? Does the database only display 8 decimal digits by default? So I changed the type in the table to double(40,20) and now the value in the database changes to: 1277.0014392408155417 (exactly 20 decimal digits) Ok, next I set the type to double(40,11) and I get: 1277.00143924000 (11 decimal digits). Anyway, I lose the last digits. WHY? I thought that the MySql double type has the same precision than the java double type? Whats wrong here? Thanks for any answers... - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC: Losing precision when mapping doubles from Java
Hi, Roland Try my JDBC Driver. http://www.t3-jpn.com/jdbc/jdbcmysql.html http://www.t3-jpn.com/jdbc/download/gweMysqlJDBC_extra3.zip Thanks. Roland wrote: Hello, I'm losing precision when I send a double to a mysql database from a Java program trough JDBC. Code: stmt.setDouble(i+3,((Double)value).doubleValue()); I use a prepared statement. Now, if I print out the double in java before sending it to the MySql database this is what it looks like: 1277.00143924408 (11 decimal digits) When I look in the database, this is what the value looks like: 1277.00143924 (8 decimal digits) snip -- TAKAHASHI, Tomohiro - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: JDBC: Losing precision when mapping doubles from Java
Hi, Roland Try my JDBC Driver. http://www.t3-jpn.com/jdbc/jdbcmysql.html http://www.t3-jpn.com/jdbc/download/gweMysqlJDBC_extra3.zip Thanks. Hello, thanks for the quick answer. Your page has a link to: http://www.gwe.co.uk/ which is not working. Is there some information in english? Sorry, but I can't read japanese :). I have downloaded your driver. And will try to test it ASAP(as soon as possible) Thanks, Roland - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
JDBC: Losing precision when mapping doubles from Java
Hello, I'm losing precision when I send a double to a mysql database from a Java program trough JDBC. Code: stmt.setDouble(i+3,((Double)value).doubleValue()); I use a prepared statement. Now, if I print out the double in java before sending it to the MySql database this is what it looks like: 1277.00143924408 (11 decimal digits) When I look in the database, this is what the value looks like: 1277.00143924 (8 decimal digits) The type of the column is double(without any precision or digits specification). Now the big question is: what happened to the last 3 decimal digits? Or is this just a display problem? Does the database only display 8 decimal digits by default? So I changed the type in the table to double(40,20) and now the value in the database changes to: 1277.0014392408155417 (exactly 20 decimal digits) Ok, next I set the type to double(40,11) and I get: 1277.00143924000 (11 decimal digits). Anyway, I lose the last digits. WHY? I thought that the MySql double type has the same precision than the java double type? Whats wrong here? Thanks for any answers... - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php