java.sql.Types,数据库字段类型,java数据类型的对应关系

来源:互联网 发布:php 输出服务器时间 编辑:程序博客网 时间:2024/04/29 14:53

当利用java从数据库读取数据时,出现

e:数字溢出           

的错误时,说明数据库表中字段长度大于10位后的所有数据均没有查询出来,此时返回值类型由int 改为BigDecimal。此外需将以下

String itemtext =rs.getString("TEXT");//Get the current row specified column valuesInt pid =rs.getInt("PID");
更改为:

String itemtext =rs.getString("TEXT");//Get the current row specified column valuesBigDecimal pid =rs.getBigDecimal("PID");

0 0