• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdbc access to DB2

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to access db2 personal edition in a remote Win2000 machine using JDBC(net driver).
The sample code is below
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
java.sql.Connection ocon=DriverManager.getConnection("jdbc b2:me2k1:JMXDB","userid","password");
System.out.println(ocon);
me2k1 is the machine name and jmxdb is the database name.
The above code throws below exception
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0616E Error opening socket
. SQLSTATE=08S01.
All the DB2 services are running in db machine.
Should I specify the port number in the URL.If so how to find the port number of the database.
The same program runs perfectly in the machine where DB2 resides.
Thanks in advance for help
 
yogendra babu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai all,
The connection is working now.
I replaced the machine name with ip address.now it is working.Thanks.
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic