zoukankan      html  css  js  c++  java
  • Springboot连接Greenplum,分页查询

    1.springboot分页查询greenplum数据报错:

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
    ### Error querying database.  Cause: com.github.pagehelper.PageException: 无法自动获取数据库类型,请通过 helperDialect 参数指定!
    ### Cause: com.github.pagehelper.PageException: 无法自动获取数据库类型,请通过 helperDialect 参数指定!
        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
        at com.sun.proxy.$Proxy151.selectList(Unknown Source)
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
        at com.sun.proxy.$Proxy171.searchBloomInfoListByDate(Unknown Source)

    在application.properties添加如下配置(必须配置在配置文件中,不能在自定义Config类中配置):

    pagehelper:
    helper-dialect: postgresql
    reasonable: true
    support-methods-arguments: true
    params: true
    default-count: true
     page-size-zero: true

     2.在Pagehelper的查询语句中,count 函数自动过滤掉了order by语句,特殊情况保留的需在 order by 语句前面添加   /*keep orderby*/  注释标识。

      注:如果使用了druid作为项目的数据库连接池还需配置druid防御SQL注入攻击 druid.wall.commentAllow=true   //是否允许语句中存在注释 

  • 相关阅读:
    射极跟随器的设计及参数确定
    三极管放大电路 之共射放大电路参数确定
    allegro生成光绘文件时,通过cam打开,*.drl钻孔文件不识别,为Unknow类型
    allegro 16.6 空心焊盘的制作
    cadence16.6 如何对齐元件
    Allegro中板子边框不封闭导致的z-copy无法用的问题
    Android Thermal-engine
    《万历十五年》--黄仁宇
    USB 接口探测分类
    Android电池电量跳变
  • 原文地址:https://www.cnblogs.com/zengming/p/11677184.html
Copyright © 2011-2022 走看看