SunQuest
           DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 15th, 2006, 02:20 AM
batigolsg batigolsg is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 1 batigolsg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 42 sec
Reputation Power: 0
Does DB2 (9.1) type 4 JDBC Driver support IPv6? Why can not connect to db via Ipv6

I installed the DB2 9.1.0.0 on RedHat Linux AS(release 4) server which has both IPv4 and IPv6 addresses. I have a simple connection test program that tried to connect to this DB2 dababase from the same machine by using the JDBC Driver type 4 that comes with DB2 9.1 but I could not make it work. When I tried the IPv4 address it worked fine. I could ping to this address by using ping6 command.
I was using the code as below.
String url = "jdbc:db2://ms.cn.ibm.com:50001/dbname";
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection con = DriverManager.getConnection(url, userID, passwd);

The JDBC Driver jar file that I used in the class path:
db2jcc.jar, sqlj.jar, db2jcc_license_cu.jar from /home/db2inst1/sqllib/java directory.

The version of the JDK I used: JDK 1.4

I got below error messages:
Exception in thread "main" java.sql.SQLException: [ibm][db2][jcc][t4][2043][11550] Exception java.net.ConnectException: Error opening socket to server ms.cn.ibm.com/2001:251:1a05:0:0:0:0:7 on port 50,001 with message: Connection refused.
at com.cyanea.common.database.DbAccess.getDbConn(DbAccess.java:167)
at com.cyanea.common.dbtest.DBTest.testDBConnection(DBTest.java:61)
at com.cyanea.common.dbtest.DBTest.main(DBTest.java:185)

However, the port 50001 is listening:
[root@ms bin]# netstat -na| grep 50001
tcp 0 0 0.0.0.0:50001 0.0.0.0:* LISTEN

Does anybody know why this is not working or did I miss any configuration to the DB2? Any help will be greatly appreciated

Reply With Quote
  #2  
Old December 15th, 2006, 07:32 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,711 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 4 h 53 m 59 sec
Reputation Power: 259
Quote:
Connection refused
so it's definitely listening, try to connect with a client tool

Reply With Quote
  #3  
Old December 16th, 2006, 10:49 AM
cotner cotner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 2 cotner User rank is Lance Corporal (50 - 100 Reputation Level)cotner User rank is Lance Corporal (50 - 100 Reputation Level)cotner User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 13 m 35 sec
Reputation Power: 0
IPV6 support for DB2

The JDBC driver does support IPv6, but currently only DB2 for z/OS V9 has the server support required to handle IPv6 messages. DB2 for Linux is working on IPv6 server support as a possible enhancement for the release after DB2 9.
Regards,
Curt Cotner


Quote:
Originally Posted by batigolsg
I installed the DB2 9.1.0.0 on RedHat Linux AS(release 4) server which has both IPv4 and IPv6 addresses. I have a simple connection test program that tried to connect to this DB2 dababase from the same machine by using the JDBC Driver type 4 that comes with DB2 9.1 but I could not make it work. When I tried the IPv4 address it worked fine. I could ping to this address by using ping6 command.
I was using the code as below.
String url = "jdbc:db2://ms.cn.ibm.com:50001/dbname";
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection con = DriverManager.getConnection(url, userID, passwd);

The JDBC Driver jar file that I used in the class path:
db2jcc.jar, sqlj.jar, db2jcc_license_cu.jar from /home/db2inst1/sqllib/java directory.

The version of the JDK I used: JDK 1.4

I got below error messages:
Exception in thread "main" java.sql.SQLException: [ibm][db2][jcc][t4][2043][11550] Exception java.net.ConnectException: Error opening socket to server ms.cn.ibm.com/2001:251:1a05:0:0:0:0:7 on port 50,001 with message: Connection refused.
at com.cyanea.common.database.DbAccess.getDbConn(DbAccess.java:167)
at com.cyanea.common.dbtest.DBTest.testDBConnection(DBTest.java:61)
at com.cyanea.common.dbtest.DBTest.main(DBTest.java:185)

However, the port 50001 is listening:
[root@ms bin]# netstat -na| grep 50001
tcp 0 0 0.0.0.0:50001 0.0.0.0:* LISTEN

Does anybody know why this is not working or did I miss any configuration to the DB2? Any help will be greatly appreciated

Reply With Quote
  #4  
Old December 17th, 2006, 06:18 PM
cotner cotner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 2 cotner User rank is Lance Corporal (50 - 100 Reputation Level)cotner User rank is Lance Corporal (50 - 100 Reputation Level)cotner User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 13 m 35 sec
Reputation Power: 0
IPv6 support for DB2

My coworkers tell me that IPv6 is supported in DB2 LUW 9 after all (my appologies for giving you misinformation).
One possibility would be a firewall that is refusing the connection. If you find it still doesn't work with the firewall temporarily disabled, I would recommend opening a PMR to have IBM service help you diagnose the problem. Your symptoms indicate that the JDBC driver is sending the request, but either the server or the firewall are refusing the connection.
Comments on this post
pabloj agrees: Thanks for this

Reply With Quote
  #5  
Old December 18th, 2006, 02:31 PM
ostler ostler is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 1 ostler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 56 sec
Reputation Power: 0
IPv6 support for DB2

The problem may be with the JRE.... there was a problem in earlier 1.4 JREs when connecting to machines that support IPV6 and IPv4. The problem was eventually fixed in JRE 1.4.2. I would give 1.4.2 a try.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Does DB2 (9.1) type 4 JDBC Driver support IPv6? Why can not connect to db via Ipv6


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway