oracle只能连接orcl库,无论程序里指定什么库名 使用plsqldeveloper:
scott,tiger连接GAOCONG库可以成功。
java程序语句:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:localhost:1521:GAOCONG", "scott", "tiger");
程序连接报错:
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