Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: DB2 on Port number 70000?

    Hi

    My client connected the DB2 on port number 70000 using JDBC and got port out of range error. My client confirmed that the DB2 is running in port number 70000.

    I checked with my DB2 (on Windows) installation, it used the default port 50000 and it did not allowed me to change the port number to 70000 (or any number greater than 65534).
    (I tried this using DB2Control Centre)

    I dont know the OS of my client, is it possible to run DB2 on port number 70000 in any OS? If so is it possible to connect using JDBC.

    Thanks in advance,
    Sn
    Last edited by Shefu; 05-31-06 at 08:25.

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    according to my knowleage a valid TCP port number is in the range of 0 to 65534. The default DB2 port on Linux/Unix/Windows is 50000.

    On Windows to check a DB2 port number execute command:
    db2 get dbm cfg | find "SVCENAME"

    The above command will return the servise name then check the file:
    C:\WINDOWS\system32\drivers\etc\services

    and search the result of above command.

    Hope this helps,
    Grofaty

  3. #3
    Join Date
    Apr 2005
    Posts
    127
    Hi ,

    Thanks for the reply Grofaty,

    My error scenario is as follows,

    My application connects to DB2 using JDBC, and the connection parameters are obtained from the user. My Client has DB2 Server running on port number 70000,
    On trying to connect to DB2 with the parameters following errors are thrown,
    Code:
    JDBC URL: jdbc:db2://test-server :70000/test_db
    Source driver data: DriverName: DB2 - Universal JDBC Driver - Type 4	DriverClasses: [com.ibm.db2.jcc.DB2Driver]	URLs: [jdbc:db2://test_server :70000/test_db]	CLASSPATH: [C:\jdbc\db2jcc.jar, C:\jdbc\db2-license-cu.jar, C:\Program Files\IBM\SQLLIB\java\db2jcc.jar]	Users: [testdemo]
    
    Exception while connecting to source database: java.lang.IllegalArgumentException: port out of range:70000
    Could you help me to identify the mistake i am doing here..

    Sn

  4. #4
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Arrow Maybe

    Try specifying the default port in your connect statement

    i.e. :50000
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  5. #5
    Join Date
    Apr 2005
    Posts
    127
    Tried with the default port number too.. it throws some error.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    TCP port is indicated by a 16-bit value and therefore cannot be more than 65534. Although you can specify port 70000 in the instance configuration and try to initiate a connection, the network will not allow you to connect.

    I guess you should tell the client's DBA that he (or she) needs to change the port to something that makes sense. I'm sure 70000 is a cool number but it just won't work.

  7. #7
    Join Date
    Aug 2005
    Posts
    2

    Thumbs down We use ports higher than 70000 in AIX DB2 v8 and v9

    We use ports higher than 70000 on two DBs in our DW AIX environment.
    The reason I saw this was that a DBA got the same out of range error using the cofiguration assistant. Using coomand line there is no problem. We have abinitio, sas, microstrategy and quest connecting no problem. This may be a Java error but it deserves investigation.

    This is the catalog node statement we actually use. Our network people want us to use 4-digit range ports as they beleive they are safer, though.

    catalog tcpip node edwdb2 remote EDW111 server 71012 remote_instance edwdb2 system EDW111 ostype AIX;

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I'd be curious to see the output of netstat -a on the server, along with the relevant entries from /etc/services...

    We'll probably see that it is actually running on port 5477 (71012 - 65535).
    Last edited by n_i; 05-08-08 at 15:27.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •