java连接数据库地址格式

错误类型:

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

解决:

Oracle JDBC Thin using an SID:

jdbc:oracle:thin:@<host>:<port>:<SID>

Oracle JDBC Thin using a ServiceName

jdbc:oracle:thin:@//<host>:<port>/<service_name>  或

jdbc:oracle:thin:@<host>:<port>/<service_name>

猜你喜欢

转载自my.oschina.net/u/3250986/blog/1814846