java.sql.BatchUpdateException: Overflow Exception

http://forum.java.sun.com/thread.jspa?threadID=657022&messageID=3861113

JDBC操作偶尔碰到这样的异常: java.sql.BatchUpdateException: Overflow Exception trying to bind NaN
在Sun的Java论坛上有人解释,当把一个非法的数字(如“0f/0f”)绑定到一个字段,执行Update操作就会报这样的错误,如下:

It looks like you did some bad arithmetic, resulting in a "Not A Number" (NaN) result. For example:

 

public class Nan {
   public static void main(String[] args) {
      float nan = 0f / 0f;
      System.out.println(nan);
   }
}
 

When you then try to store that value in a floating point column, the database complains. So the problem is in your Java logic, and the database is trying to prevent you from corrupting the column!

It's not specific to the BatchUpdate, it just happened to occur in one, and so the BatchUpdate had to report the error.

你可能感兴趣的:(java,thread,sql,jdbc,sun)