jdbc - Not able to establish database connection in eclipse -


i want make new database connection (db2) in eclipse purpose of using jpa. in jpa perspective, in data source explorer view, when try create new db connection, receive following logs when try ping server.

org.eclipse.datatools.connectivity.exceptions.dbnotstartexception: no start database command issued. errorcode = -4499, sqlstate = 08001.     @ org.eclipse.datatools.enablement.ibm.db2.internal.luw.jdbcluwjdbcconnection.getconnectexception(jdbcluwjdbcconnection.java:74)     @ org.eclipse.datatools.connectivity.ui.pingjob.gettestconnectionexception(pingjob.java:81)     @ org.eclipse.datatools.connectivity.ui.pingjob.run(pingjob.java:63)     @ org.eclipse.core.internal.jobs.worker.run(worker.java:54) caused by: com.ibm.db2.jcc.am.ro: [jcc][t4][2043][11550][4.8.87] exception java.net.connectexception: error opening socket server example.example.com/51.37.93.117 on port 50,000 message: connection timed out: connect. errorcode=-4499, sqlstate=08001     @ com.ibm.db2.jcc.am.gd.a(gd.java:319)     @ com.ibm.db2.jcc.am.gd.a(gd.java:337)     @ com.ibm.db2.jcc.t4.zb.a(zb.java:378)     @ com.ibm.db2.jcc.t4.zb.<init>(zb.java:76)     @ com.ibm.db2.jcc.t4.a.y(a.java:306)     @ com.ibm.db2.jcc.t4.b.a(b.java:1796)     @ com.ibm.db2.jcc.am.lb.a(lb.java:570)     @ com.ibm.db2.jcc.am.lb.<init>(lb.java:522)     @ com.ibm.db2.jcc.t4.b.<init>(b.java:306)     @ com.ibm.db2.jcc.db2simpledatasource.getconnection(db2simpledatasource.java:214)     @ com.ibm.db2.jcc.db2driver.connect(db2driver.java:456)     @ org.eclipse.datatools.connectivity.drivers.jdbc.jdbcconnection.createconnection(jdbcconnection.java:328)     @ org.eclipse.datatools.connectivity.driverconnectionbase.internalcreateconnection(driverconnectionbase.java:105)     @ org.eclipse.datatools.connectivity.driverconnectionbase.open(driverconnectionbase.java:54)     @ org.eclipse.datatools.connectivity.drivers.jdbc.jdbcconnection.open(jdbcconnection.java:96)     @ org.eclipse.datatools.enablement.ibm.db2.internal.luw.jdbcluwconnectionfactory.createconnection(jdbcluwconnectionfactory.java:26)     @ org.eclipse.datatools.connectivity.internal.connectionfactoryprovider.createconnection(connectionfactoryprovider.java:83)     @ org.eclipse.datatools.connectivity.internal.connectionprofile.createconnection(connectionprofile.java:359)     @ org.eclipse.datatools.connectivity.ui.pingjob.createtestconnection(pingjob.java:76)     @ org.eclipse.datatools.connectivity.ui.pingjob.run(pingjob.java:59)     ... 1 more caused by: java.net.connectexception: connection timed out: connect     @ java.net.dualstackplainsocketimpl.connect0(native method)     @ java.net.dualstackplainsocketimpl.socketconnect(unknown source)     @ java.net.abstractplainsocketimpl.doconnect(unknown source)     @ java.net.abstractplainsocketimpl.connecttoaddress(unknown source)     @ java.net.abstractplainsocketimpl.connect(unknown source)     @ java.net.plainsocketimpl.connect(unknown source)     @ java.net.sockssocketimpl.connect(unknown source)     @ java.net.socket.connect(unknown source)     @ com.ibm.db2.jcc.t4.ab.run(ab.java:34)     @ java.security.accesscontroller.doprivileged(native method)     @ com.ibm.db2.jcc.t4.zb.a(zb.java:372)     ... 18 more 

and able connect database using dbvisualizer.

error opening socket server {machine} on :

  1. port 60,000 message: connection refused. errorcode=-4499, sqlstate=08001

  2. port 50,000 message: connection timed out: connect. errorcode=-4499, sqlstate=08001

in first one, connection refusal can either 50,000 (port) or 60,000 (tcp/ip).

in case, problem can caused possibly because:

  1. there's instance using port (50,000 indicates not availability of db2)
  2. or port has issue (firewall blockage, wrong port number,..)

check library you're using import com.ibm.db2.jcc.*; , set right port setportnumber(port). use telnet 51.37.93.117 50000 in command line check availability of port, if blank screen port open else port might close/busy.

use link here reference steps can take db2 configuration in data source exploreron how stop, set, update , start commands re-connect or create database.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

Kivy: Swiping (Carousel & ScreenManager) -