If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix XPS JDBC connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-03, 18:30
Angelia Angelia is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Informix XPS JDBC connection

Hi,

When I try to connect to XPS use JDBC, I got the following message:

java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (xx) failed.
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliCon nect.java:950)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java :243)
at java.sql.DriverManager.getConnection(DriverManager .java:543)
at java.sql.DriverManager.getConnection(DriverManager .java:216)
at infxjdbc.main(infxjdbc.java:32)

the URL is:
"jdbc:informix-sqli://hostort:INFORMIXSERVER=myserver;user=user;passwo rd=password"

I got the port number from /etc/services file, and all the other variables are no problem.

I use the same java class to connect to IDS, no problem at all.

I can connect to the XPS server through DBAccess(Local), but can't do it remotely.

Any idea?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-19-03, 20:03
Amit Dandekar Amit Dandekar is offline
Registered User
 
Join Date: Oct 2003
Posts: 29
Check sqlhost entry for the server instance to make sure that you are using ontlitcp and not shared memory .
Reply With Quote
  #3 (permalink)  
Old 11-20-03, 14:10
Angelia Angelia is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Thanks Amit.

I checked the sqlhosts file, and I found I did use shared memory connection, so I changed it to ontlitcp, like:

xx ontlitcp host xx.1
xx.1 ontlitcp host xx.1

and in the /etc/services file:

xx.1 7100/tcp #Informix database client connection

when I try to connect locally, i got this error:
908: Attempt to connect to database server (xx) failed.

I can't get connected even on local.

Do I need to change anything else for the TCP/IP connection?

Thanks!


Quote:
Originally posted by Amit Dandekar
Check sqlhost entry for the server instance to make sure that you are using ontlitcp and not shared memory .
Reply With Quote
  #4 (permalink)  
Old 11-20-03, 14:38
Amit Dandekar Amit Dandekar is offline
Registered User
 
Join Date: Oct 2003
Posts: 29
1) Verify that you can connect remotely using dbaccess ,
to make sure that everything is set correctly on your engine.
2) With JDBC , You need not set anything special .
Make sure that you are using correct connection , something like
"jdbc:informixsqli://myhost:8765:informixserver=xps_instance1+"user=mys elf" + ";password=guess";

Make sure that if you are specifying
informixserver as xx
then you give port number for instance xx and NOT for xx.1
Reply With Quote
  #5 (permalink)  
Old 11-20-03, 14:53
Angelia Angelia is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Thanks Amit.

After I use ontlitcp, I couldn't get connected through dbaccess on local, and couldn't get connected remotely using dbaccess.

There is only one port number for instance xx and xx.1, they use same service name.


Quote:
Originally posted by Amit Dandekar
1) Verify that you can connect remotely using dbaccess ,
to make sure that everything is set correctly on your engine.
2) With JDBC , You need not set anything special .
Make sure that you are using correct connection , something like
"jdbc:informixsqli://myhost:8765:informixserver=xps_instance1+"user=mys elf" + ";password=guess";

Make sure that if you are specifying
informixserver as xx
then you give port number for instance xx and NOT for xx.1
Reply With Quote
  #6 (permalink)  
Old 11-20-03, 16:57
Angelia Angelia is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Hi, Amit,

I got it connected. :-)

The problem is the server is not started after I made all the changes.

Thanks a lot!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On