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();
		}

  

posted @ 2019-08-05 14:48  黑魔法os  阅读(1041)  评论(0编辑  收藏  举报