Topic
IC4NOTICE: 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.
6 replies Latest Post - ‏2012-09-03T15:20:23Z by Mark Gillis
Mark Gillis
Mark Gillis
4 Posts
ACCEPTED ANSWER

Pinned topic Default port number -1

‏2012-08-30T13:23:25Z |
Hi

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
jdbc:db2://localhost:-1/LOGBOOK:retrieveMessagesFromServerOnGetMessage=true;

Anyone know how to get round this?

Mark
Updated on 2012-09-03T15:20:23Z at 2012-09-03T15:20:23Z by Mark Gillis
  • loicjulien
    loicjulien
    96 Posts
    ACCEPTED ANSWER

    Re: Default port number -1

    ‏2012-08-30T17:00:16Z  in response to Mark Gillis
    Hi,

    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,
    ~Loic
  • Mark Gillis
    Mark Gillis
    4 Posts
    ACCEPTED ANSWER

    Re: Default port number -1

    ‏2012-08-31T14:01:20Z  in response to Mark Gillis
    Unfortunately 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.

    Mark

    A connection attempt was unsuccessful.

    Summary

    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.

    Explanation

    Explanation:

    An attempt was made to access a database that was not found, has not been started, or does not support transactions.

    User response:

    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.
    SQLSSTATE: 08004

    Support

    Connection Properties

    Database : LogBook
    URL : jdbc:db2://localhost:50000/LogBook:retrieveMessagesFromServerOnGetMessage=true;securityMechanism=4;
    User name : mgillis
    Password : (Not Shown)

    Environment

    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

    Stack Trace

    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)
    com.ibm.db2.jcc.am.id.a(Unknown Source)
    com.ibm.db2.jcc.t4.xb.a(Unknown Source)
    com.ibm.db2.jcc.t4.xb.<init>(Unknown Source)
    com.ibm.db2.jcc.t4.a.z(Unknown Source)
    com.ibm.db2.jcc.t4.b.a(Unknown Source)
    com.ibm.db2.jcc.am.kb.a(Unknown Source)
    com.ibm.db2.jcc.am.kb.<init>(Unknown Source)
    com.ibm.db2.jcc.t4.b.<init>(Unknown Source)
    com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(Unknown Source)
    com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(Unknown Source)
    com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
    com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
    org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(Unknown Source)
    org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(Unknown Source)
    org.eclipse.datatools.connectivity.DriverConnectionBase.open(Unknown Source)
    org.eclipse.datatools.enablement.ibm.db2.internal.luw.JDBCLUWConnectionFactory.createConnection(Unknown Source)
    org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(Unknown Source)
    org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(Unknown Source)
    com.ibm.datatools.connection.internal.ui.databases.NewDatabaseConnnectionWizardPage.handleTestConnection(Unknown Source)
    com.ibm.datatools.connection.internal.ui.databases.NewDatabaseConnnectionWizardPage.access$6(Unknown Source)
    com.ibm.datatools.connection.internal.ui.databases.NewDatabaseConnnectionWizardPage$10.handleEvent(Unknown Source)
    org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    org.eclipse.jface.window.Window.runEventLoop(Unknown Source)
    org.eclipse.jface.window.Window.open(Unknown Source)
    com.ibm.datatools.connection.internal.ui.databases.actions.NewDBConnectionHandler.execute(Unknown Source)
    org.eclipse.ui.internal.handlers.HandlerProxy.execute(Unknown Source)
    org.eclipse.core.commands.Command.executeWithChecks(Unknown Source)
    org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(Unknown Source)
    org.eclipse.ui.internal.handlers.HandlerService.executeCommand(Unknown Source)
    org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(Unknown Source)
    org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(Unknown Source)
    org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(Unknown Source)
    org.eclipse.ui.menus.CommandContributionItem.access$19(Unknown Source)
    org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(Unknown Source)
    org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
    org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
    org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
    org.eclipse.ui.internal.Workbench$7.run(Unknown Source)
    org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
    org.eclipse.ui.internal.ide.application.IDEApplication.start(Unknown Source)
    org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
    org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
    org.eclipse.equinox.launcher.Main.run(Unknown Source)
    org.eclipse.equinox.launcher.Main.main(Unknown Source)
    • loicjulien
      loicjulien
      96 Posts
      ACCEPTED ANSWER

      Re: Default port number -1

      ‏2012-08-31T18:03:31Z  in response to Mark Gillis
      Hi 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:

      db2set DB2COMM=protocol_names

      For example, to set the database manager to start connection managers for the TCP/IP communication protocols, enter the following commands:

      db2set DB2COMM=tcpip
      db2stop
      db2start

      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)

      Thanks,
      ~Loic
      • Mark Gillis
        Mark Gillis
        4 Posts
        ACCEPTED ANSWER

        Re: Default port number -1

        ‏2012-09-03T13:50:48Z  in response to loicjulien
        Hi 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

        Mark
    • YuanFeng
      YuanFeng
      78 Posts
      ACCEPTED ANSWER

      Re: Default port number -1

      ‏2012-09-01T13:47:16Z  in response to Mark Gillis
      another thing you may check is if db2 get dbm cfg check your SVCENAME

      for example
      TCP/IP Service name (SVCENAME) = db2c_DB2
      and if you are using windows
      C:/Windows/System32/drivers/etc/services
      check the port used for db2c_DB2
      if it is linux or other platform,check in below file
      /etc/services

      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
      • Mark Gillis
        Mark Gillis
        4 Posts
        ACCEPTED ANSWER

        Re: Default port number -1

        ‏2012-09-03T15:20:23Z  in response to YuanFeng
        Aha: 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

        Mark