嗨,我在window 7 os中安装了Oracle 10g。在执行我的JDBC程序时,我遇到了问题。我使用此URL jdbc:oracle:thin:@localhost:1521:XE。我试过用 jdbc:oracle:thin:@localhost:1521 / XE然后它也无法正常工作。
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
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:389)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.jlcindia.jdbc.JDBCUtils.getOracleConnection(JDBCUtils.java:18)
at com.jlcindia.jdbc.Lab4.main(Lab4.java:10)