+ Reply to Thread
Results 1 to 5 of 5

setting up the connection pool in netbeans for informix database

  1. setting up the connection pool in netbeans for informix database

    Hello!

    I have trouble with setting up the connection pool for informix database
    in netbeans ide 6.0.1
    I've found netbeans tutorial which explains how to set up the connection
    pool for mysql database. I followed the steps from tutorial,but it
    doesn't work for informix database.

    I have index.jsp page on which I have drop-down list which should be
    filled in with data dynamically.

    First error I've received was:
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    to get connection, DataSource invalid: "java.sql.SQLException: Error in
    allocating a connection. Cause: Class name is wrong or classpath is not
    set for: com.informix.jdbc.IfxDataSource"

    I've solved this by adding the ifxjdbcx.jar to my project's library.

    But, the second error I don't know how to handle:
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    to get connection, DataSource invalid: "java.sql.SQLException: Error in
    allocating a connection. Cause:
    java.lang.StringIndexOutOfBoundsException cannot be cast to
    java.sql.SQLException"

    This is the part of web.xml file:


    jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01
    jdbc/IfxDatabase
    javax.sql.DataSource
    Container
    Shareable


    And this is the content of sun-resources.xml file:


    Server 9.0 Resource Definitions //EN"
    "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">

    object-type="user" pool-name="IfxDatabasePool">


    associate-with-thread="false" connection-creation-retry-attempts="0"
    connection-creation-retry-interval-in-seconds="10"
    connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
    connection-validation-method="auto-commit"
    datasource-classname="com.informix.jdbcx.IfxDataSource"
    fail-all-connections="false" idle-timeout-in-seconds="300"
    is-connection-validation-required="false"
    is-isolation-level-guaranteed="true" lazy-connection-association="false"
    lazy-connection-enlistment="false" match-connections="false"
    max-connection-usage-count="0" max-pool-size="32"
    max-wait-time-in-millis="60000" name="IfxDatabasePool"
    non-transactional-connections="false" pool-resize-quantity="2"
    res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1"
    steady-pool-size="8" validate-atmost-once-period-in-seconds="0"
    wrap-jdbc-objects="false">
    value="jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01"/>





    I can't find what is wrong. I would appreciate very much if someone
    could give me any advice. Thanks in advance.

  2. Re: setting up the connection pool in netbeans for informix database

    try:


    jdbc:informix-sqli://
    192.168.242.131:9088:INFORMIXSERVER=ifx01;database=ifxdatabase


    Assume that your database is called ifxdatabase


    Superboer.


    On 14 mei, 13:10, La Farfalla wrote:
    > Hello!
    >
    > I have trouble with setting up the connection pool for informix database
    > in netbeans ide 6.0.1
    > I've found netbeans tutorial which explains how to set up the connection
    > pool for mysql database. I followed the steps from tutorial,but it
    > doesn't work for informix database.
    >
    > I have index.jsp page on which I have drop-down list which should be
    > filled in with data dynamically.
    >
    > First error I've received was:
    > javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    > to get connection, DataSource invalid: "java.sql.SQLException: Error in
    > allocating a connection. Cause: Class name is wrong or classpath is not
    > set for: com.informix.jdbc.IfxDataSource"
    >
    > I've solved this by adding the ifxjdbcx.jar to my project's library.
    >
    > But, the second error I don't know how to handle:
    > javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    > to get connection, DataSource invalid: "java.sql.SQLException: Error in
    > allocating a connection. Cause:
    > java.lang.StringIndexOutOfBoundsException cannot be cast to
    > java.sql.SQLException"
    >
    > This is the part of web.xml file:
    >
    >
    > jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01
    > jdbc/IfxDatabase
    > javax.sql.DataSource
    > Container
    > Shareable
    >

    >
    > And this is the content of sun-resources.xml file:
    >
    >
    > > Server 9.0 Resource Definitions //EN"
    > "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
    >
    > > object-type="user" pool-name="IfxDatabasePool">
    >
    >

    > > associate-with-thread="false" connection-creation-retry-attempts="0"
    > connection-creation-retry-interval-in-seconds="10"
    > connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
    > connection-validation-method="auto-commit"
    > datasource-classname="com.informix.jdbcx.IfxDataSource"
    > fail-all-connections="false" idle-timeout-in-seconds="300"
    > is-connection-validation-required="false"
    > is-isolation-level-guaranteed="true" lazy-connection-association="false"
    > lazy-connection-enlistment="false" match-connections="false"
    > max-connection-usage-count="0" max-pool-size="32"
    > max-wait-time-in-millis="60000" name="IfxDatabasePool"
    > non-transactional-connections="false" pool-resize-quantity="2"
    > res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1"
    > steady-pool-size="8" validate-atmost-once-period-in-seconds="0"
    > wrap-jdbc-objects="false">
    > > value="jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01"/>
    >
    >
    >

    >

    >
    > I can't find what is wrong. I would appreciate very much if someone
    > could give me any advice. Thanks in advance.



  3. Re: setting up the connection pool in netbeans for informix database

    Superboer wrote:
    > try:
    >
    >
    > jdbc:informix-sqli://
    > 192.168.242.131:9088:INFORMIXSERVER=ifx01;database=ifxdatabase
    >
    >
    > Assume that your database is called ifxdatabase
    >
    >
    > Superboer.
    >
    >


    I've tryed
    jdbc:informix-sqli://192.168.242.131:9088:INFORMIXSERVER=ifx01;database=ifxdatabase,
    as you suggested, instead of
    jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01,
    but I'm still receiving the same error:

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    to get connection, DataSource invalid: "java.sql.SQLException: Error in
    allocating a connection. Cause:
    java.lang.StringIndexOutOfBoundsException cannot be cast to
    java.sql.SQLException"

    Do you have any other suggestion?
    Thanks for trying to help me.

  4. Re: setting up the connection pool in netbeans for informix database

    hmm not really assume that

    User" value="bpadmin"
    Password" value="pass"

    is correct, can you try this using dbaccess ->> connection--> user
    bpadmin -->passwd pass

    also did you check if your informix jdbc driver is in your path...

    you could goto the examples and see/test if you can get that to
    work....

    hmmm may be when you try to a onstat -m
    you may see error 952 in the log meaning that the user/passwd is not
    correct.


    this:

    Cause:
    java.lang.StringIndexOutOfBoundsException cannot be cast to
    java.sql.SQLException"

    is very weird, sounds like maybe driver not in classpath???


    Superboer.



    On 15 mei, 15:59, La Farfalla wrote:
    > Superboer wrote:
    > > try:

    >
    > > jdbc:informix-sqli://
    > > 192.168.242.131:9088:INFORMIXSERVER=ifx01;database=ifxdatabase

    >
    > > Assume that your database is called ifxdatabase

    >
    > > Superboer.

    >
    > I've tryed
    > jdbc:informix-sqli://192.168.242.131:9088:INFORMIXSERVER=ifx01;database=ifxdatabase,
    > as you suggested, instead of
    > jdbc:informix-sqli://192.168.242.131:9088/ifxdatabase:INFORMIXSERVER=ifx01,
    > but I'm still receiving the same error:
    >
    > javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable
    > to get connection, DataSource invalid: "java.sql.SQLException: Error in
    > allocating a connection. Cause:
    > java.lang.StringIndexOutOfBoundsException cannot be cast to
    > java.sql.SQLException"
    >
    > Do you have any other suggestion?
    > Thanks for trying to help me.



  5. Re: setting up the connection pool in netbeans for informix database

    The connection string is correct, I can connect to my database and I've
    checked if my informix jdbc driver is in the classpath. Everything is
    correct. My SQL query is also correct, so I guess I'm in the blind
    street. I really don't know what is wrong, I even don't have any idea
    what should I try next.

+ Reply to Thread