I've just downloaded Data Studio to do a bit of 'self-education'. I've got DB2 10.1 AESE installed on a Windows 7 Pro laptop. Data Studio has evidently located my database directory and created an entry for each database on my machine, but has defined localhost with a single port of -1. Unsurprisingly no connection will work. The port number is greyed out in the database porperties and only a refresh option is offered from the Adminstration tab.
Oddly if I attempt a new driver definition from database properties the Connection URL is changed to jdbc:db2://localhost:50000/SAMPLE:retrieveMessagesFromServerOnGetMessage=true;
but when I OK this it reverts to
Anyone know how to get round this?
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
6 replies Latest Post - 2012-09-03T15:20:23Z by Mark Gillis
Pinned topic Default port number -1
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-09-03T15:20:23Z at 2012-09-03T15:20:23Z by Mark Gillis
loicjulien 2700007DEB96 PostsACCEPTED ANSWER
Re: Default port number -12012-08-30T17:00:16Z in response to Mark GillisHi,
I do not know where the port number discrepancy is coming from. We read the values coming straight from the client.
To get around this, you can always create a brand new definition within Data Studio. Under the New drop-down menu of the Administration Explorer icon bar, you can select "New Connection to a Database" and define the desired connection properties.
Hope this helps,
Re: Default port number -12012-08-31T14:01:20Z in response to Mark GillisUnfortunately Loic that just gives an SQL4499 error. The new connection does default to a port number of 50000 and that is what appears in the connection URL but the same failure occurs for all local databases, details below if you (or anyone else out there) can follow them. The implication is that the database(s) in question are not catalogued in the system directory but a list db directory shows that they are, and can be connected to from CLP.
A connection attempt was unsuccessful.
SQL4499N A fatal error occurred that resulted in a disconnect from the data source.
Try the following suggestions to help solve the problem:
Ensure that the data server has been started.
Check that the database name used is the actual database name and not an alias name.
Check that the host is a valid name or IP address, and that the port number is valid for communication with the data server.
To further diagnose the problem, return to the Properties section and use the Tracing page to enable tracing. Contact the database administrator and provide the trace and other support information available.
Full message content: jcct4204311550http://4.13.111 Exception java.net.ConnectException: Error opening socket to server localhost/127.0.0.1 on port 50,000 with message: Connection refused: connect.
An attempt was made to access a database that was not found, has not been started, or does not support transactions.
Ensure that the specified database name exists in the system database directory. If the database name does not exist in the system database directory, either the database does not exist or the database name has not been cataloged. If needed, issue a db2start command and then resubmit the current command.
Database : LogBook
URL : jdbc:db2://localhost:50000/LogBook:retrieveMessagesFromServerOnGetMessage=true;securityMechanism=4;
User name : mgillis
Password : (Not Shown)
Driver class name = com.ibm.db2.jcc.DB2Driver
Driver version = 4.13.111
Driver JAR file path = C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.1.403.v20120228_2105\driver\db2jcc4.jar;C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.1.403.v20120228_2105\driver\db2jcc_license_cisuz.jar
Operating system name = Windows 7
Operating system architecture = x86
Operating system version = 6.1 build 7600
JVM implementation vendor = IBM Corporation
JVM runtime = Java(TM) SE Runtime Environment
Java version = JRE 1.6.0 IBM J9 2.4 Windows 7 x86-32 jvmwi3260sr10-20111207_96808 (JIT enabled, AOT enabled)
J9VM - 20111207_096808
JIT - r9_20111107_21307ifx1
GC - 20110519_AA
Launcher = C:\Program Files\IBM\DS3.1.1\eclipse.exe
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: jcct4204311550http://4.13.111 Exception java.net.ConnectException: Error opening socket to server localhost/127.0.0.1 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001com.ibm.db2.jcc.am.id.a(Unknown Source)
loicjulien 2700007DEB96 PostsACCEPTED ANSWER
Re: Default port number -12012-08-31T18:03:31Z in response to Mark GillisHi Mark,
Thanks for your answer.
It could be that TCP/IP may not be properly enabled on your DB2 database server.
We can try to see if this would fix this by doing the following:
Use the db2set DB2COMM command from the DB2 command window to start the TCP/IP connection:
For example, to set the database manager to start connection managers for the TCP/IP communication protocols, enter the following commands:
If this does not address this, would you mind using the "Tracing" panel of the same "New connection dialog" to enable JCC tracing and attach the trace to the post. This will help us better understand what is going on. (http://www.ibm.com/developerworks/data/library/techarticle/dm-0706scanlon/index.html)
Re: Default port number -12012-09-03T13:50:48Z in response to loicjulienHi Loic
I can confirm that DB2COMM=TCPIP so I've switched tracing on and resubmitted a Test Connection. Here's the output (trace_sds_10): any and all help appreciated
YuanFeng 2700030G5D78 PostsACCEPTED ANSWER
Re: Default port number -12012-09-01T13:47:16Z in response to Mark Gillisanother thing you may check is if db2 get dbm cfg check your SVCENAME
TCP/IP Service name (SVCENAME) = db2c_DB2
and if you are using windows
check the port used for db2c_DB2
if it is linux or other platform,check in below file
you can check whether it is use 50000 port, or maybe some other application already use 50000 port,then you can also edit in the services file and restart db2 to use the new port,and remember to edit the port in connection profile also
Re: Default port number -12012-09-03T15:20:23Z in response to YuanFengAha: it looks as if this suggestion is the one that might have cracked it. I've done an update dbm cfg using SVCENAME db2c_DB2 followed by a db2stop / db2start and it now seems to work. I'm not sure where the original issue has come from (the default portnumber) but this has got me round the issue.
Thanks for your help