localdate转date时区问题_shardingsphere oracle各种问题总结

本文详细介绍了在SpringBoot项目中使用ShardingSphere 4.1.1与Oracle数据库时遇到的表不存在和时区转换问题。启动服务时由于JdbcUtil.getSchema方法在Oracle中的实现导致查询所有表时出现问题。通过重写该方法解决了表不存在的错误。然而,不分页查询返回空结果,分页查询则抛出表或视图不存在的错误,此问题在MySQL中不存在。尝试了不同版本的ShardingSphere,最终4.0.0-RC1版本运行正常,但出现了一个新的问题,即在关联查询中使用括号导致错误,去掉括号后恢复正常。
摘要由CSDN通过智能技术生成

本文说下shardingsphere使用oracle数据库下的各种问题。

环境:springboot2.2.10.RELEASE+mybatis+jpa+shardingsphere4.1.1

1、配置文件

  • pom.xml
1.84.1.1org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-data-jpaorg.mybatis.spring.bootmybatis-spring-boot-starter2.1.3com.github.pagehelperpagehelper4.1.3org.apache.shardingspheresharding-jdbc-spring-boot-starter${shardingsphere.version}com.github.norauiojdbc712.1.0.2
  • application.yml
server:  port: 9900---spring:  shardingsphere:    enabled: true    props:      sql:        show: true    datasource:      names: ds0      ds0:        type: com.zaxxer.hikari.HikariDataSource        driverClassName: oracle.jdbc.OracleDriver #com.mysql.cj.jdbc.Driver        jdbcUrl: jdbc:oracle:thin:@10.100.102.113:1521/orcl #jdbc:mysql://localhost:3306/ds0?serverTimezone=GMT%2B8        username: empi #root        password: empi #123123        minimumIdle: 10        maximumPoolSize: 200        autoCommit: true        idleTimeout: 30000        poolName: DS0DatabookHikariCP        maxLifetime: 1800000        connectionTimeout: 30000        connectionTestQuery: SELECT 1 FROM DUAL    sharding:      tables:        t_order: #逻辑表名          actualDataNodes: ds$->{0}.t_order_$->{2020..2020}0$->{1..9}, ds$->{0}.t_order_$->{2020..2020}$->{10..12} #实际表          tableStrategy: #分表策略            standard: #标准分片策略              shardingColumn: order_date #分片字段              preciseAlgorithmClassName: com.pack.sharding.algorithm.DateTableShardingAlgorithm              rangeAlgorithmClassName: com.pack.sharding.algorithm.DataTabeRangeShardingAlgorithm        t_product:          actualDataNodes: ds$->{0}.t_product_$->{0..1}          tableStrategy:            inline:              shardingColumn: id              algorithmExpression: t_product_$->{id & 1}          t_comment:          actualDataNodes: ds$->{0}.t_comment_$->{0..1}          t
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值