麒麟OS + DM8数据库(Graalvm for JDK17) 测试

发布时间:2024年01月11日

1、添加依赖

implementation 'com.dameng:DmJdbcDriver18:8.1.3.62'

implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.4'

2、application.yml 数据源配置

spring:

? datasource:

??? driver-class-name: dm.jdbc.driver.DmDriver #com.mysql.cj.jdbc.Driver

??? url: jdbc:dm://192.168.1.209:5236/SYSDBA?rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8

??? username: SYSDBA

???? password: dmdba@2025

???? type: com.alibaba.druid.pool.DruidDataSource

3、ORM实体类

@Data

@TableName(value="DM_USERS")

public class SysUser {

????????private static final long serialVersionUid=1L;

????????@TableId(value="USER_ID",type= IdType.AUTO)

????????private Long id;

????????@TableField(value="USER_NAME")

????????private String name;

}

4、Mapper

@Mapper

public interface SysUserMapper extends BaseMapper<SysUser> {

}

5、测试类

@Autowired

private SysUserMapper userMapper;

@Test

public void testDmQuery(){

????????var users=sysUserMapper.selectList(null);

????????users.forEach(System.out::println);

}

测试结果

文章来源:https://blog.csdn.net/python2007cn/article/details/135532824
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。