免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2316 | 回复: 0
打印 上一主题 下一主题

Win2003Server下用IPV6地址访问数据源问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-28 09:30 |只看该作者 |倒序浏览
在win 2003 server下配置好了IPV6协议,获取到分配的IPV6地址,ipconfig得到的
Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   IP Address. . . . . . . . . . . . : 9.181.85.19
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   IP Address. . . . . . . . . . . . : fe80::20d:60ff:fe92:c31b%5
   Default Gateway . . . . . . . . . : 9.181.85.1

安装的是DB2 9,已经支持IPV6了,我希望验证是否能用IPV6地址访问数据源,写了下面这个简单的链接,但是都报错不能识别出IPV6地址,我也用了[fe80::20d:60ff:fe92:c31b%5]或者[::1]也不行,换成localhost或者127.0.0.1可以,怀疑是机器还有那里没有配置好。希望有大虾能指点迷津,谢谢!
public static void main(String[] args) throws SQLException {
               
                try {
                        Class.forName("com.ibm.db2.jcc.DB2Driver");
                 String databaseURL = "jdbc:db2://[fe80::20d:60ff:fe92:c31b]:50000/sample";
                        java.util.Properties properties = new java.util.Properties ();
                        properties.setProperty ("user","user");
                        properties.setProperty ("password","password");
                        Connection conn = DriverManager.getConnection(databaseURL,properties);
                       
                        /**//** print any error messages **/
                        if(conn==null){System.out.println("Connection Failed \n");
                                }else
                                {
                                        System.out.println("Connection Got it");
                                }
                    
                } catch (ClassNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP