如何使用Java中的服务名称连接到Oracle

时间:2019-07-24 16:32:29

标签: java oracle jdbc service-name

我需要在Java中连接到oracle db

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=servicename)))");

我遇到错误了

java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.core.exceptions.WrongArgumentException: Malformed database URL, failed to parse the main URL sections.

0 个答案:

没有答案