为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:dm8
【操作系统】:win10
【CPU】:Intel® Core™ i5
【问题描述】:springboot上面配置mybatis查询dm8数据库,查询结果一直为空,即使用select count() from “xxx”.“xxx”;返回结果依然为0,使用dm管理工具可以正常查询,结果不为空。
mybatis配置如下:
spring.druid.driverClassName=dm.jdbc.driver.DmDriver
spring.druid.url=jdbc:dm://localhost:5236/Example?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
spring.druid.username=SYSDBA
spring.druid.password=xxxxxxx
spring.druid.test-while-idle=false
xml文件内容如下
<resultMap id="test" type="com.gkjt.security.entity.Test">
<id column="id" jdbcType="INTEGER" property="id"></id>
<result column="name" jdbcType="VARCHAR" property="name"></result>
</resultMap>
<select id="getById" resultMap="test" parameterType="java.lang.Integer">
select * from "Example"."test" where "id"=#{id};
</select>
<select id="getCount" resultType="INTEGER">
select count(*) from "Example"."test" ;
</select>
问题已解决。
我的解决方法 : commit
大哥我现在也碰到了这个问题,想请教一下怎么解决的!
利用Druid Monitor查看sql执行结果正常,如下图:
