软件下载吧文章资讯

分类分类

如何解决Java MybatisPlus SqlServer OFFSET 分页问题

2024-02-05 11:03作者:下载吧

问题

使用MybatisPlus 连接 SqlServer 数据库 ,在分页的时候发生了如下的报错,sql语句和报错如下:

Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。

SQL: SELECT  * FROM tb_admin  OFFSET 0 ROWS FETCH NEXT 15 ROWS ONLY

错误源码重现

依赖

		<!-- mybatis-plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
<!-- SqlServer依赖-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
<version>7.4.1.jre8</version>
</dependency>
展开全部

相关文章

说两句网友评论
    我要跟贴
    取消