sql,outside valid range for the datatype INTEGER.

Account在mysql数据库中类型为varchar(20).Account有个值是‘o001’.
使用dbutils,执行以下函数
public Ordinaryusers findUserByAccount(String Account) {
String sql="select * from ordinaryusers where Account='o001'";
try{
QueryRunner runner =new QueryRunner(DaoUtils.getSource());
return runner.query(sql, new BeanHandler(Ordinaryusers.class));
}catch(Exception e){
e.printStackTrace();
throw new RuntimeException(e);
}
}
报错:java.sql.SQLException: '1.7722222222E10' in column '5' is outside valid range for the datatype INTEGER.
采用普通连接数据库的方式调用以下函数
public Ordinaryusers findUserByAccount1(String Account) {
Connection connection = null;
PreparedStatement pStatement = null;
ResultSet rSet = null;
String sql="select * from ordinaryusers where Account='o001'";
Ordinaryusers obj = new Ordinaryusers();
try {
connection = Connect.getConnection();
pStatement = connection.prepareStatement(sql);
rSet = pStatement.executeQuery();
while(rSet.next()) {
obj.setAccount(rSet.getString(1));
obj.setPassword(rSet.getString(2));
}
}catch (Exception e) {
e.printStackTrace();
}finally {
try {
Connect.close(rSet, pStatement, connection);
}catch (Exception e) {
e.printStackTrace();
}
}
return obj;
}
就没有问题,实验了多次,发现第一个函数只要是o开头的数字就会出错,Account如果是其他字符串目前没问题,是不是dbutils框架里面有把字符串先转换为int的操作导致溢出?

o不是8进制,0(零)才是,而且不要引号
String sql="select * from ordinaryusers where Account=" +0001;

是第5个字段数据超范围,但你的代码应该没有用到, 所以不要用*, 用实际用到的字段代替

 String sql="select Account, Password from ordinaryusers where Account='o001'";
 ......
 while(rSet.next()) {
obj.setAccount(rSet.getString(1));
obj.setPassword(rSet.getString(2)); // Account 和Password不是一个字段吧?不能都取第一个啊?
}