当前位置: 代码迷 >> Informix >> informix数据库连接时,localhost无效,只能使用IP?解决方案
  详细解决方案

informix数据库连接时,localhost无效,只能使用IP?解决方案

热度:1017   发布时间:2013-02-26 00:00:00.0
informix数据库连接时,localhost无效,只能使用IP?
jdbc:informix-sqli://localhost:1526/loan:informixServer=hust
将上面的URL换成
jdbc:informix-sqli://192.1.9.100:1526/loan:informixServer=hust
才能正常连接,否则报错(127.0.0.1也不行):
java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (hust) failed.
也就是说,如果机器没连网,就不能访问数据库,太郁闷了。。。
请指教,这个问题困扰我好久了,一直没解决,谢谢!

------解决方案--------------------------------------------------------
Windows下的Informix没有sqlhosts,Unix环境下的informix才有sqlhosts
  相关解决方案