+关注继续查看

# 问题出现的背景和原因

WARN com.alibaba.druid.pool.DruidAbstractDataSource - oracle.jdbc.driver.OracleDriver is deprecated.Having use oracle.jdbc.OracleDriver

# 思考的路永远欢迎你踏上去

Package oracle.jdbc

Beginning in Oracle9i, the Oracle extensions to JDBC are captured in the package oracle.jdbc. This package contains classes and interfaces that specify the Oracle extensions in a manner similar to the way the classes and interfaces in java.sql specify the public JDBC API.

Your code should use the package oracle.jdbc instead of the package oracle.jdbc.driver used in earlier versions of Oracle. Use of the package oracle.jdbc.driver is now deprecated, but will continue to be supported for backwards compatibility.

All that is required to covert your code is to replace "oracle.jdbc.driver" with "oracle.jdbc" in the source and recompile. This cannot be done piece-wise. You must convert all classes and interfaces that are referenced by an application. Conversion is not required, but is highly recommended. Future releases of Oracle may have features that are incompatible with use of the package oracle.jdbc.driver.

The purpose of this change is to enable the Oracle JDBC drivers to have multiple implementations. In all releases up to and including Oracle9i, all of the Oracle JDBC drivers have used the same top level implementation classes, the classes in the package oracle.jdbc.driver. By converting your code to use oracle.jdbc, you will be able to take advantage of future enhancements that use different implementation classes. There are no such enhancements in Oracle9i, but there are plans for such enhancements in the future.

Additionally, these interfaces permit the use of some code patterns that are difficult to use when your code uses the package oracle.jdbc.driver. For example, you can more easily develop wrapper classes for the Oracle JDBC classes. If you wished to wrap the OracleStatement class in order to log all SQL statements, you could easily do so by creating a class that wraps OracleStatement. That class would implement the interface oracle.jdbc.OracleStatement and hold an oracle.jdbc.OracleStatement as an instance variable. This wrapping pattern is much more difficult when your code uses the package oracle.jdbc.driver as you cannot extend the class oracle.jdbc.driver.OracleStatement.

Once again, your code should use the new package oracle.jdbc instead of the package oracle.jdbc.driver. Conversion is not required as oracle.jdbc.driver will continue to be supported for backwards compatibility. Conversion is highly recommended as there may in later releases be features that are not supported if your code uses oracle.jdbc.driver.

Since:

9i

java.sql

# 解决办法多数情况是一种取舍

省略……
datasource:
master:
url: jdbc:mysql://xxx.xxx.xxx.xxx:3306/jmd-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
multi-card-oracle:
url: jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxxxxxx
driver-class-name: oracle.jdbc.driver.OracleDriver

oracle.jdbc.driver.OracleDriver替换为oracle.jdbc.OracleDriver就可以了消除上面的告警信息了。

## 关于MySQL的驱动器类

2097 0
Oracle的学习心得和知识总结（五）|Oracle数据库 Connect By 技术详解

84 0
Oracle数据库检查分区表信息
check table partition on oracle database，Oracle数据库检查分区表信息，需要最新的统计信息
180 0
Oracle 数据库性能优化3日实战(企业培训)

1895 0
Java中通过JDBC远程连接Oracle数据库

1925 0
oracle 12c 数据库上编写SQL语句时卡顿的问题解决

1494 0
RHEL6 64位系统安装ORACLE 10g 64bit 数据库
RHEL6 64位系统安装ORACLE 10g 64bit 数据库 2013-08-10 22:12 by 潇湘隐者, 9673 阅读, 2 评论, 收藏, 编辑    记得去年4月份的时候，为公司部署测试环境和UAT环境时，在红帽RHEL6 64位系统安装ORACLE 10g 64位数据库时遇到了许多小问题，当时匆匆忙忙也没记录一下这些问题，前几天在虚拟机安装ORACLE 64位 10g时，又有一些常见问题又遇到了，顺便整理一下这篇文章。
1119 0
+关注

Oracle 至PostgreSQL案例分享

ORACLE 10g 数据库体系结构图