This discussion is archived
8 Replies Latest reply: Oct 10, 2002 11:22 AM by 807581 RSS

Connecting to informix database using IBM Informix driver

807581 Newbie
Currently Being Moderated
Hi,
While iam trying to connect to informix database using IBMInformix driver iam getting an error that couldn't interact with database, but while i try with merant driver it's working perfectly fine.

i have created the connection pool with the following parameters:

DataSource ClassName :com.informix.jdbcx.IfxDataSource

Properties:
IfxIFXHost:<Host Name>
portNumber: 1543
serverName: <database Name>
user
password

i have included class path for ifxjdbcx.jar and ifxjdbc.jar

i don't know why it is failing to connect where as it works perfectly fine with merant driver.

thanks in advance,

vijay
  • 1. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Did you define JDBC resource ? This step defines a JDBC resource and associates it with the connection pool entry. You can use CLI command create-jdbc-resource or use Admin GUI to do it. Please refer to the Getting Started Guide for detail instructions.

    http://docs.sun.com/source/816-7146-10/ch6-database-setup.html

    Thanks,
    Judy
  • 2. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Vijay,

    Looking at the sample configuration that comes as part of the Informix driver: ( demo/pickaseat/source/pasDataSource.java)

    ifxds.setDescription("Pick-A-Seat Data Source");
    ifxds.setIfxIFXHOST("158.58.60.88");
    ifxds.setPortNumber(179);
    ifxds.setUser("demo");
    ifxds.setPassword("demo");
    ifxds.setServerName("ipickdemo_tcp");
    ifxds.setDatabaseName("ipickaseat");

    The property <serverName> should be the server name, and not the database name. If needed, please provide a new property called <databaseName> for the database name, try this, and let us know if it works for you.

    -Nelson
  • 3. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Hi
    I followed these steps and it worked ...

    1.     Created a Connection Pool with the following parameters:
    Datasource Classname : com.informix.jdbcx.IfxDataSource
    Properties
    IfxIFXHost: sharavati
    PortNumber: 1543
    ServerName: sundb
    User: informix
    Password: test123
    DatabaseName : jdbctest

    2.     Later configure the required JDBC resource with the newly created Connection Pool.

    3.     Later append the class path in the server.xml or in the server1 -> JVM Settings -> Path Settings and in Classpath-suffix with these jar files location
    <driver install location>\lib\ifxjdbcx.jar
    <driver install location>\lib\ifxjdbc.jar
  • 4. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Hi
    I followed these steps and it worked ...

    1.     Created a Connection Pool with the following parameters:
    Datasource Classname : com.informix.jdbcx.IfxDataSource
    Properties
    IfxIFXHost: sharavati
    PortNumber: 1543
    ServerName: sundb
    User: informix
    Password: test123

    Vijay
    DatabaseName : jdbctest

    2.     Later configure the required JDBC resource with the newly created Connection Pool.

    3.     Later append the class path in the server.xml or in the server1 -> JVM Settings -> Path Settings and in Classpath-suffix with these jar files location
    <driver install location>\lib\ifxjdbcx.jar
    <driver install location>\lib\ifxjdbc.jar
  • 5. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Hi Vijay,

    Thanks for posting back your result which can benefit other users of the forum. The three steps you listed here are the key things to get the database connection.

    Thanks,
    Judy
  • 6. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    Hi, I have done exactly what you did.
    But I couldn't managed to make it work.
    I get the following message:

    An error has occurred.
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: Can't load driver java.lang.NoSuchMethodException: com.informix.jdbc.IfxSqliConnect.(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)

    What's wrong?

    Thanks
    Massimo
  • 7. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    I'm am getting the same error was this ever solved? I'm using Netbeans 6 with GlassFish and trying to create a web app and have in connect to an Informix database.

    Cheers
  • 8. Re: Connecting to informix database using IBM Informix driver
    807581 Newbie
    Currently Being Moderated
    I'm getting the same error too. I'm using Netbeans 6 with GlassFish too and trying to create a web application and have in connect to an Informix database.

    It's very important for me...


    Nivrae