JDBC Connection is not establising
466874Nov 9 2005 — edited Jun 10 2008Hello,
I am facing a problem in establishing a connection. In my application i am getting the connection metadata from transaction.
ConnectionMetadata con = getTransaction().getConnectionMetadata();
Then i am getting the URL from that connection metadata
String URL = con.getJdbcURL();
the URL that i am getting is,
jdbc:oracle:thin:APPLSYSPUB/PUB@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ap612sdb.us.oracle.com)(PORT=20102)))
(CONNECT_DATA=(SID=20102)))
with this URL and giving the username and password i am not able to establish the connection . The error i am getting is pasted below,
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821760)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3678)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
when i changed the SID value in URL from 20102 to the instance name, i am able to connect to the DB.
Does this 20102 is the PORT number?
Can anyone please suggest me what exactly is happening.
Thanks in advance.
Regards,
Sindhu