java hibernate oracle,java – 无法使用Spring Boot和Hibernate连接到Oracle

我有一个使用Postgres的 Spring Boot应用程序(1.2).今天我正在尝试将其切换到Oracle,但是当我尝试连接时,我得到一个异常,说:

java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

在那之下,

Caused by: java.net.ConnectException: Connection refused

当然,这看起来像是糟糕的凭据,但我知道它们很好,而且他们在Oracle SQL Developer中工作得很好.我很困惑.这是我的属性文件条目:

# Properties for Hibernate and Oracle

spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver

spring.datasource.url=jdbc:oracle:thin:@//earth-db-11:5121/stardev

spring.datasource.username=ops$abcdefg

spring.datasource.password=mypassword

spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect

我唯一的想法就是用户名中有一个$,我试图转义并在其周围加上双引号.

有任何想法吗?

谢谢…

更新:

非常感谢BonanzaOne,我的端口号错了.更正会导致新错误:

java.sql.SQLRecoverableException: Listener refused the connection with the following error:

ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

当然,我查了一下,但我没有按照它告诉我的说法:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Cause: The listener received a request to establish a connection to a database

or other service. The connect descriptor received by the listener specified a

service name for a service (usually a database service) that either has not yet

dynamically registered with the listener or has not been statically configured

for the listener. This may be a temporary condition such as after the listener

has started, but before the database instance has registered with the listener.

不过,SQL Explorer连接正常.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值