Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    4

    Unanswered: 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;password=pas sword"

    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!

  2. #2
    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 .

  3. #3
    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!


    Originally posted by Amit Dandekar
    Check sqlhost entry for the server instance to make sure that you are using ontlitcp and not shared memory .

  4. #4
    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

  5. #5
    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.


    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

  6. #6
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •