List:MySQL and Java« Previous MessageNext Message »
From:kristina Date:July 24 2003 8:30pm
Subject:Storing infinity values to MySql database from a java application.
View as plain text  
MySql does not seem appreciate infinity values from a Java application.
From a Mysql command line, an infinite value may be placed in the database.
As in:

mysql> CREATE TABLE Result
    -> (
    ->   value DOUBLE
    -> ) TYPE = InnoDB;
Query OK, 0 rows affected (0.23 sec)

mysql> insert into result values(1e500);
Query OK, 1 row affected (0.06 sec)

mysql> select * from result;
+--------+
| value  |
+--------+
| 1.#INF |
+--------+
1 row in set (0.02 sec)

But from a Java application the following does not work.

String query = "insert into result values(1e500)";
Statement stmt = null;
try{
      stmt = getConnection().createStatement();
      stmt.execute( query );
    }

results in the following error message:
"Unknown column 'Infinity' in 'field list'"

I have also tried this as a PreparedStatement with the same results.

Thread
Storing infinity values to MySql database from a java application.kristina24 Jul
  • Re: Storing infinity values to MySql database from a java application.Mark Matthews25 Jul
Re: Storing infinity values to MySql database from a java application.kristina26 Jul
  • Re: Storing infinity values to MySql database from a java application.Mark Matthews26 Jul
  • The error on MySQL Connector/J 3.08 JDBC driver !Huy Phan31 Jul
    • RE: The error on MySQL Connector/J 3.08 JDBC driver !Jaap31 Jul