Topic
  • 3 replies
  • Latest Post - ‏2011-01-31T11:13:49Z by Edcornishe
Edcornishe
Edcornishe
3 Posts

Pinned topic Uncaught exception 'PDOException' with message 'invalid data source name'

‏2011-01-20T18:28:20Z |
Hi,

we are testing the CA1S PHP for CICS with the test script PDODB2Test.php but we are facinf the bellow error,

Fatal error: Uncaught exception 'PDOException' with message 'invalid data source name' in /ca1s_HOME/ca1s/work/examples/PDO/PDODB2Test.php:2 Stack trace: #0 /ca1s_HOME/ca1s/work/examples/PDO/PDODB2Test.php(2): PDO->PDO('jdbc:default:co...') #1 {main} thrown in /ca1s_HOME/ca1s/work/examples/PDO/PDODB2Test.php on line 2

All the steps regarding accessing the db with the PHP is doneand the CICS DB connection also looks good, are we missing here something do we need any more configration do be done with respect to this.

Need your help out here,

Thanks,
Ed
Updated on 2011-01-31T11:13:49Z at 2011-01-31T11:13:49Z by Edcornishe
  • JonathanPLawrence
    JonathanPLawrence
    30 Posts

    Re: Uncaught exception 'PDOException' with message 'invalid data source name'

    ‏2011-01-21T09:59:38Z  
    Hello Ed,

    The first thing to mention is that the CA1S SupportPac is not supported and you should move to the CICS Transaction Server Feature Pack for Dynamic Scripting (http://www.ibm.com/software/htp/cics/scripting/) as soon as possible. NB this requires CICS Transaction Server v4.1. CICS Dynamic Scripting includes the same PHP technology as the CA1S SupportPac, and is supported as a CICS Feature.

    In answer to your specific problem, the documentation for accessing DB2 databases from PHP via PDO is missing a step. The Java (TM) Library Path needs to include the /lib directory for the JDBC drivers. This can be achieved by adding an entry to LIBPATH_SUFFIX in the CA1S JVM profile, similar to:

    LIBPATH_SUFFIX=/usr/lpp/db2910/lib:\
    /MV26/p8build/ca1s/p8/lib

    Once this change has been made, you will need to phase out your JVMs to ensure the change is picked up.

    It is also worth noting that there might be more information about the error in the JVM sysout/syserr files. Depending on your JVM profile, these should be located under the WORK_DIR directory specified in the JVM profile, possibly in the /logs subdirectory if you used the supplied CA1SJVMP profile with minimum changes. For example if I reproduce the problem I see the following in the dfhjvmerr file:
    com.ibm.db2.jcc.am.SqlException: jcc1038912245http://3.57.91 Failure in loading native library db2jcct2zos, java.lang.UnsatisfiedLinkError: db2jcct2zos (Not found in java.library.path): ERRORCODE=-4472, SQLSTATE=null
    at com.ibm.db2.jcc.am.bd.a(bd.java:660)
    at com.ibm.db2.jcc.am.bd.a(bd.java:60)
    at com.ibm.db2.jcc.am.bd.a(bd.java:94)
    at com.ibm.db2.jcc.t2.a.a(a.java:37)

    Jonathan Lawrence
    CICS PHP & Dynamic Scripting
    IBM United Kingdom Limited
  • Edcornishe
    Edcornishe
    3 Posts

    Re: Uncaught exception 'PDOException' with message 'invalid data source name'

    ‏2011-01-25T20:57:50Z  
    Hi,

    Thank for the information. The LIBPATH_SUFFIX is added and a region recycle is made still we are getting the same error .

    All we have as a doubt is the thet 'jdbc:default:connection' is not established.
    Till now java/jdbc batch execution is running fine, all we have as a doubt is the cics/Jdbc connection is working out fine.

    Can you help us how to chedk on the CICS/JDBC connectivity, is there any sample trasaction provided by the IBM that would help us as far i am not able to collect one.

    One more question does the PHP PDO db2/jdbc connect require that the datasource method of making a jdbc connection is there any other method?

    Also does the PHP requires IIOP to be configured to work with these connectivity on corba application

    Regards,
    Ed
  • Edcornishe
    Edcornishe
    3 Posts

    Re: Uncaught exception 'PDOException' with message 'invalid data source name'

    ‏2011-01-31T11:13:49Z  
    Hello Ed,

    The first thing to mention is that the CA1S SupportPac is not supported and you should move to the CICS Transaction Server Feature Pack for Dynamic Scripting (http://www.ibm.com/software/htp/cics/scripting/) as soon as possible. NB this requires CICS Transaction Server v4.1. CICS Dynamic Scripting includes the same PHP technology as the CA1S SupportPac, and is supported as a CICS Feature.

    In answer to your specific problem, the documentation for accessing DB2 databases from PHP via PDO is missing a step. The Java (TM) Library Path needs to include the /lib directory for the JDBC drivers. This can be achieved by adding an entry to LIBPATH_SUFFIX in the CA1S JVM profile, similar to:

    LIBPATH_SUFFIX=/usr/lpp/db2910/lib:\
    /MV26/p8build/ca1s/p8/lib

    Once this change has been made, you will need to phase out your JVMs to ensure the change is picked up.

    It is also worth noting that there might be more information about the error in the JVM sysout/syserr files. Depending on your JVM profile, these should be located under the WORK_DIR directory specified in the JVM profile, possibly in the /logs subdirectory if you used the supplied CA1SJVMP profile with minimum changes. For example if I reproduce the problem I see the following in the dfhjvmerr file:
    com.ibm.db2.jcc.am.SqlException: jcc1038912245http://3.57.91 Failure in loading native library db2jcct2zos, java.lang.UnsatisfiedLinkError: db2jcct2zos (Not found in java.library.path): ERRORCODE=-4472, SQLSTATE=null
    at com.ibm.db2.jcc.am.bd.a(bd.java:660)
    at com.ibm.db2.jcc.am.bd.a(bd.java:60)
    at com.ibm.db2.jcc.am.bd.a(bd.java:94)
    at com.ibm.db2.jcc.t2.a.a(a.java:37)

    Jonathan Lawrence
    CICS PHP & Dynamic Scripting
    IBM United Kingdom Limited
    Hi,

    Thank for the information. The LIBPATH_SUFFIX is added and a region recycle is made still we are getting the same error .

    All we have as a doubt is the thet 'jdbc:default:connection' is not established.
    Till now java/jdbc batch execution is running fine, all we have as a doubt is the cics/Jdbc connection is working out fine.

    Can you help us how to chedk on the CICS/JDBC connectivity, is there any sample trasaction provided by the IBM that would help us as far i am not able to collect one.

    One more question does the PHP PDO db2/jdbc connect require that the datasource method of making a jdbc connection is there any other method?

    Also does the PHP requires IIOP to be configured to work with these connectivity on corba application

    Regards,
    Ed