Db2 Tools for zOS

 View Only
  • 1.  SQLJ compilation

    Posted Wed November 27, 2024 09:17 AM

    We are using IBM DB2 databases for our application and we use IBM Dataserver runtime client 11.5.7 in our application server to connect to DB2 server. We have SQLJ files to be compiled using the DB2 runtime client. With version 10 we were able to compile SQLJ files using sqlj.zip and other depencies. After updating the runtime client to 11.5..7 e are unable to compile SQLJ files. When we run sqlj and db2sqljcustomize command following error occurs :
    'db2sqljcustomize' is not recognized as an internal or external command
    'db2sqljcustomize' is not recognized as an internal or external command

    As mentioned in (https://www.ibm.com/docs/en/db2/11.1?topic=apis-installing-data-server-driver-jdbc-sqlj),I installed IBM Data Server Driver for JDBC and SQLJ client  and got sqlj4.zip . But still I am unable to compile SQLJ files..Need help to resolve this compilation issues



    ------------------------------
    Rajakumari Rajasekaran
    ------------------------------


  • 2.  RE: SQLJ compilation

    Posted Thu November 28, 2024 05:23 AM

    C:\>which db2sqljcustomize
    /c/SQLLIB/BIN/db2sqljcustomize

    So make sure the PATH env variable points to the SQLLIB/BIN folder 

    As an alternate to the windows command you can use below class as well.

    SQLJ command
    java sqlj.tools.Sqlj samplesqlj.sqlj

    db2sqljcustomize command
    java com.ibm.db2.jcc.sqlj.Customizer -url jdbc:db2://host:port/database -user username -password password samplesqlj_SJProfile0.ser

    After migrating to 11.5.* replace the CLASSPATH with the sqlj4.zip for SQLJ and db2jcc4.jar for JCC driver.



    ------------------------------
    Kollol Misra
    ------------------------------



  • 3.  RE: SQLJ compilation

    Posted Thu November 28, 2024 07:18 AM

    @Kollol Misra

    Thanks for your response. I have added the paths of SQLLIB/BIN , sqlj4.zip, db2jcc4.jar in CLASSPATH and PATH. When I run the java command you shared i get following error :

    java sqlj.tools.Sqlj SampleSQLJ.sqlj
    Error: Could not find or load main class sqlj.tools.Sqlj 

    Also can you please let me know if you have db2sqljcustomize file inside SQLLIB/BIN path ? I have the sqlj4.zip in SQLLIB/java , should we need any other files for SQLJ compilation ?



    ------------------------------
    Rajakumari Rajasekaran
    ------------------------------



  • 4.  RE: SQLJ compilation

    Posted Thu November 28, 2024 05:12 PM

    I think this might be a PATH issue.  Kinda suggests the program is not found.  Maybe you could try ./db2sqljcustomize

     

     






  • 5.  RE: SQLJ compilation

    Posted Fri November 29, 2024 07:19 AM

    @Phill Baker

    I dont have any dll or exe file for ./db2sqljcustomize. I have installed IBM DB2 Runtime Client 11.5 (RTCCL) and I checked the SQLLIB/BIN path and couldn't find. Can you please let me know if we need any files for run db2sqljcustomize and  sqlj command ?
    I get error for both sqlj command and db2sqljcustomize command 
    'sqlj' is not recognized as an internal or external command
    'db2sqljcustomize' is not recognized as an internal or external command

    Please let me know what are the dependency files to run the sqlj and db2sqljcustomize command successfully. Do we have any other ibm  software available to get dependency  for sqlj compilation. Also let me know the path in which you usually have db2sqljcustomize.



    ------------------------------
    Rajakumari Rajasekaran
    ------------------------------



  • 6.  RE: SQLJ compilation

    Posted Sun December 01, 2024 05:44 PM

    Hi

     

    Hope you have got past this now.  But if not one thought is that you need the full server driver.  The runtime RTC is minimal set of BINs to run application, but you are trying to develop/deploy application, hence full driver is needed.  I did try to spend little time looking for what driver you need but had no luck, so above is my best guess.....

     

     






  • 7.  RE: SQLJ compilation

    Posted Mon December 02, 2024 06:52 PM

    Hi try this link https://www.ibm.com/support/pages/node/7175827

     

    IBM Data Server Client

    This is the all in one client package and includes all the client tools

    and libraries available. It includes add-ins for Visual Studio.

     

    C:\Program Files (x86)\IBM\SQLLIB\BIN>dir *cust*

    Volume in drive C has no label.

    Volume Serial Number is A8F7-AFF8

     

    Directory of C:\Program Files (x86)\IBM\SQLLIB\BIN

     

    10/08/2024  12:34 PM            49,744 db2sqljcustomize.exe

                   1 File(s)         49,744 bytes

                   0 Dir(s)  370,045,689,856 bytes free

     

     






  • 8.  RE: SQLJ compilation

    Posted Tue December 03, 2024 12:53 AM

    Hi Phil,
    Thank you for sharing software download link...I will install this and will try to compile my sqlj files.



    ------------------------------
    Rajakumari Rajasekaran
    ------------------------------