dbTalk Databases Forums  

JDBC Connection Problem

comp.databases.informix comp.databases.informix


Discuss JDBC Connection Problem in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
markmadison@mail.com
 
Posts: n/a

Default JDBC Connection Problem - 03-11-2011 , 10:07 AM






Hello,

I am having problems connecting via JDBC to my locally running
Informix 11.7 instance on my Mac, OS 10.6. I have this problem when
trying with a couple of a Java GUI query tools.

In /etc/services:

ol_informix117 20200/tcp
dr_informix117 21788/tcp

In sqlhosts:

demo_on onipcshm on_hostname on_servername
demo_se seipcpip se_hostname sqlexec
ol_informix117 onsoctcp localhost ol_informix117


My attempted JDBC URLs:

jdbc:informix-sqli://localhost:20200/
mydb:INFORMIXSERVER=ol_informix117
jdbc:informix-sqli://127.0.0.1:20200/
mydb:INFORMIXSERVER=ol_informix117
jdbc:informix-sqli://192.68.123.22:20200/
mydb:INFORMIXSERVER=ol_informix117

I tried different users, including the informix user and password.

The error:

com.informix.asf.IfxASFException:
Attempt to connect to database server (ol_informix117) failed.

Unfortunately the driver does not provide any additional details, such
as bad host, bad servername, bad database, bad user/password, etc.

I can connect to mydb using dbaccess just fine, including "dbaccess
mydb@ol_informix117".

When I try and telnet to localhost, port 20200, I can connect
successfully. If I send garbage the connection is aborted and there is
an message in the Informix log file. There is no message in the log
file when I fail to connect via JDBC (not sure if that is normal).

Also, there is no firewall running.

Can anyone help?

Reply With Quote
  #2  
Old   
markmadison@mail.com
 
Posts: n/a

Default Re: JDBC Connection Problem - 03-14-2011 , 11:09 AM






On Mar 11, 3:41*pm, Mark Jamison <maj... (AT) me (DOT) com> wrote:
Quote:
Localhost is your likely problem

JDBC is not resolving the sqlhost entry.

Best solution would be to either use your machine name or a *

I used to run into the same problem on my MacBook pro
Thank you for the help.

I changed sqlhosts to use 127.0.0.1, and that seemed to solve the
problem.

Thanks again!

Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.