免费注册 查看新帖 |

Chinaunix

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

一个关于informix 的JDBC问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-20 10:52 |只看该作者 |倒序浏览
我从网上找了很多的JDBC,但是大多就只是写了一段代码,里面有些什么东西,怎么配置,写得不是很详细,弄不明白,想请教下。
Class.forName("com.informix.jdbc.IfxDriver");

String full_db="jdbc:informix-sqli://10.14.86.11:300/authority: INFORMIXSERVER=ifx9;user=informix;password=informix;NEWLOCALE=en_us,zh_tw;NEWCODESET=Big5,8859-1,819;";

con =DriverManager.getConnection(full_db);

想请问下“INFORMIXSERVER=”后面连接的是什么东西,还有就是user 和password是数据库用户名和密码还是登陆linux的用户名和密码?
另外NEWLOCALE=en_us,zh_tw;NEWCODESET=Big5,8859-1,819;;这个是什么意思,我看有的人后面没有写这个东西?是不是可有可无的呢?

我是在WINDOWS 下连接一台LINUX下的informix,数据库是checkid@ids0,表名是outbank。linux的登陆用户名名和密码是“informix”,“123123”。具体的话,我要怎么配置呢?

另外想请教下,informix下的数据库名,如checkid@ids0中的@ids0代表的是什么意思?

论坛徽章:
0
2 [报告]
发表于 2006-09-20 10:57 |只看该作者
我自己是怎么写的:
Class.forName("com.informix.jdbc.IfxDriver").newInstance();
                        String url="jdbc:informix-sqli://192.168.0.52:9533/checkid:INFORMIXSERVER=ids0;user=informix;password=123123";
                        String user="informix";
                        String password="123123";
                        //conn= DriverManager.getConnection(url,user,password);
                        conn = DriverManager.getConnection(url);

但是编译出现这样的提示:
java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (checkid@ids0) failed.
        at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:1026)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.informix.jdbc.IfxDriver.connect(IfxDriver.java:254)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at informixnect.informix.main(informix.java:19)
Inser SQLException

有人能告诉我出错在哪里吗?

论坛徽章:
0
3 [报告]
发表于 2006-09-21 14:02 |只看该作者
com.informix.jdbc.IfxDriver

jdbc驱动入口

jdbc:informix-sqli://10.14.86.11:300/authority: INFORMIXSERVER=ifx9;user=informix;password=informix;NEWLOCALE=en_us,zh_tw;NEWCODESET=Big5,8859-1,819;

jdbc             主协议名称
informix-sqli    子协议名称
10.14.86.11:300  数据库服务器地址、端口
authority        数据库名称
INFORMIXSERVER   参数,服务器版本?
user password    数据库访问验证
后面两个是国际化区域代码、编码方式。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP