运行Java程序时出现INFORMIX错误 [英] INFORMIX error on running a Java program

查看:586
本文介绍了运行Java程序时出现INFORMIX错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用Java编写的小程序连接到Informix数据库.

I have been trying to connect to an Informix database using a small program written in Java.

该程序可以在其中一台Informix测试服务器上正常运行,但是在生产系统之一上运行时,它会为我们提供以下异常:

The program is working nicely on one of the Informix test servers but on running in one of the production system it gives us the following exception:

java.sql.SQLException:INFORMIXSERVER与两个都不匹配 DBSERVERNAME或DBSERVERALIASES.

java.sql.SQLException: INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES.

我做了一些研究,并检查了以下两个值之间的差异.

I did some research and have checked the following two values for discrepancies.

  1. 命令echo $INFORMIXSERVER的输出.

服务器上onconfig文件中DBSERVERNAME的值,位于$INFORMIXDIR/etc目录中.

Value of the DBSERVERNAME in the onconfig file on the server, present in the $INFORMIXDIR/etc directory.

这两个值相同,我看不出这两个值有什么问题.

The value of these two are the same and I can't see any problem in these two values.

你们能建议我对这个问题的解决方案,或者在我可以寻找解决方案的任何地方给我一些建议吗?

Can you guys please suggest me some solution to this or any place where I can look for solution?

谢谢.

推荐答案

您的连接字符串应类似于:

Your connection string should look something like:

jdbc:informix-sqli://HOSTNAME:PORT:informixserver=DBSERVERNAME;user=USERNAME;password=PASSWORD;

例如,如果您的informix sql主机文件看起来像:

If, for example, your informix sql hosts file looks like:

infx1150        onsoctcp        tardis 15115   k=1

然后,密码为the_key的用户informix的连接字符串应类似于:

Then, your connection string for the user informix with the password the_keyshould be like:

jdbc:informix-sqli://tardis:15115:informixserver=infx1150;user=informix;password=the_key;

您收到的错误提示您连接字符串上的informixserver值与给定主机上的DBSERVENAME不匹配.

The error you're getting says that the informixserver value on your connection string doesn't match a DBSERVENAME on the given host.

这意味着您正在到达连接字符串上的主机和端口,但没有到达DBSERVERNAME.

That means you are reaching the host and the port on the connection string, but not the DBSERVERNAME.

这篇关于运行Java程序时出现INFORMIX错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆