Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: port number of ORACLE for JDBC
Look at your tnsnames.ora file. It will include the port and the Oracle SID you need for your connection
Thanks,
John
Anne Hanson wrote in message <34B05BF6.31A7_at_ix.netcom.com>...
>I am trying to use JDBC to connect to our Oracle database. I am using
>the QueryApp example from the Oreilly book "Database Programming with
>JDBC and Java." I keep getting "connection refused" when trying to
>connect with JDBC. I can connect to the database using sqlplus so I
>know it is up and functioning. I suspect that I am using the wrong
>port number in my URL for the getConnection() call. I am using port
>1521 in my URL but I don't know how to find out if that is the correct
>port. How do I find out the port number to use in my JDBC code?
>
>My environment is:
>
>Sun Solaris 2.5.1
>Oracle 7.2.3.3.0
>jdk 1.1.4
>oracle jdbc driver (latest driver from oracle - sorry don't know the
>version)
>
>My URL looks like:
>
>jdbc:oracle:thin:@myhost.mydomain.com:1521:mysid
>
>Thanks in advance.
>
>Jeff Hanson
>Senior Software Engineer
>StorageTek
>Jeff_Hanson at stortek dot com
Received on Sun Jan 11 1998 - 00:00:00 CST