0

Hi , I have installed Oracle 10g in window 7 os. While executing my JDBC program I am getting below problem. Im using this URL jdbc:oracle:thin:@localhost:1521:XE . I tried with
jdbc:oracle:thin:@localhost:1521/XE then also it is not working .

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)
Jacob
  • 14,463
  • 65
  • 207
  • 320
  • From command prompt try doing `tnsping xe` and see what it returns. – Jacob Aug 24 '14 at 11:52
  • possible duplicate of [ORA-12505, TNS:listener does not currently know of SID given in connect descriptor](http://stackoverflow.com/questions/18192521/ora-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript) – Luke Woodward Aug 25 '14 at 08:20

1 Answers1

0

You need to add the SID entry for XE in order to register the instance with the listener.

Solution

Hope this helps

Community
  • 1
  • 1
Bjarte Brandt
  • 4,191
  • 2
  • 23
  • 25