Home » RDBMS Server » Enterprise Manager » Oracle Port number (Orace 11.2.0. Windows Vista Business 32 bit)
Oracle Port number [message #542736] Fri, 10 February 2012 00:29 Go to next message
Messages: 45
Registered: January 2012
Location: VADODARA


While connecting my oracle with My JDBC driver
i got an SQLException:
public class Orajdbc {
public static void main(String args[])
Connection con = DriverManager.getConnection
 ("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");
if (con == null)
System.out.println("Connection not successful");
catch (Exception e)

java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at Orajdbc.main(Orajdbc.java:20)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
... 7 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:337)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
... 12 more
i am successfully conected by type 1 odbc driver but while i want to connect it with "ojdbc6.jar" file then i got this exception i already added that jar file to my Enviroument variable ClASSPATH ..

also tell me how to find port number of my OracleService?

[Updated on: Fri, 10 February 2012 01:02] by Moderator

Report message to a moderator

Re: Oracle Port number [message #542749 is a reply to message #542736] Fri, 10 February 2012 01:04 Go to previous message
Michel Cadot
Messages: 61941
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
tell me how to find port number of my OracleService?

Ask your DBA.

Note: you don't need any port to connect locally.

Previous Topic: OEM 10g backup notification.
Next Topic: Runing a sql query on EM
Goto Forum:

Current Time: Wed Oct 07 11:34:15 CDT 2015

Total time taken to generate the page: 0.11460 seconds