mysql oracle sqlserver三种数据库count函数返回值不一样
SQLQuery countSqlQuery = userDAO.createSQLQuery("select count(id) from fhcb_08_tbl_user"); BigInteger totalCount=null; if(databaseutil.getValue("database").equalsIgnoreCase("sqlserver")){ totalCount = BigInteger.valueOf(((Integer)countSqlQuery.uniqueResult()).intValue()); }else if(databaseutil.getValue("database").equalsIgnoreCase("mysql")){ totalCount = (BigInteger)countSqlQuery.uniqueResult(); }else if(databaseutil.getValue("database").equalsIgnoreCase("oracle")){ totalCount =((BigDecimal)countSqlQuery.uniqueResult()).toBigInteger(); }