# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES = (NTS)
连接 jdbc Oracle10g 错误 ,JDBC代码无问题,服务也启动,连接字符串也是对的,但是在eclipse 下报错,错误信息如下:
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
The Connection descriptor used by the client was:
localhost:1521:orcl
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:279)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:318)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:343)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:147)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at cn.com.db.DBAccess.getConnection(DBAccess.java:33)
at cn.com.db.DBAccess.main(DBAccess.java:95)
Null
在CMD下snrctl status ,tnsping orcl 显示都正常。
在pl/SQL下用
select open_mode from v$database;
show parameter instance;
select INSTANCE_NAME from v$instance;
sqlplus sys/oracle@orcl
查询都显示正常,就是用pl/sql 登录时 填“数据库名” orcl 就无法登陆,报ora -12514
l最后有效的解决方法:
修改listener.ora文件
原listener.ora文件:
# listener.ora Network Configuration File: D:\oracle\product\10.1.0\Db_4\network\admin\listener.ora
# Generated by Oracle configuration tools.