Results 1 to 5 of 5

Thread: Dba

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Unanswered: Dba

    Hi,
    I am running a DB2 program on SUN/Solaris server with DB2 V 9.7 with the unix environment and getting following error while testing two different programs:
    PrvfDomain.java
    hs@[report_server]:
    (/home/db2inst1/dev/Govardhan)> javac CTableUtilizationPTP.java
    hs@[report_server]:
    (/home/db2inst1/dev/Govardhan)> java CTableUtilizationPTP
    COM.ibm.db2.jdbc.app.DB2Driver
    java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
    at java.lang.Class.forName(Class.java:130)
    at CTableUtilizationPTP.getConnection(CTableUtilizati onPTP.java:197)
    at CTableUtilizationPTP.getQueryStatement(CTableUtili zationPTP.java:282)
    at CTableUtilizationPTP.countRows(CTableUtilizationPT P.java:172)
    at CTableUtilizationPTP.classify(CTableUtilizationPTP .java:80)
    at CTableUtilizationPTP.main(CTableUtilizationPTP.jav a:57)
    hs@[report_server]:
    (/home/db2inst1/dev/Govardhan)> java -classpath ./ CreatePRVF
    Exception in thread "main" java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.ap
    p.DB2Driver
    at java.lang.Class.forName(Class.java:130)
    at JDBCConnection.getConnection(JDBCConnection.java:4 4)
    at CreatePRVF.main(CreatePRVF.java:36)
    hs@[report_server]:


    can someone help me out please asap.

    thank you
    gsp

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Not sure what help you are looking for here.

    Do you have db2java.zip in your class path ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Mar 2011
    Posts
    4

    dba

    I have db2java.zip in the same directory as is the CreatePRVF.java program that I am trying to run.
    But it fails, during the connection to DB2 thread.
    I cannot figure it out.
    Could someone help please!

    Thank You
    Govardhan

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Just because it is in the same directory, does not mean it is in the classpath. If the jars are not in the classpath, java cannot find them. Add the jars explicitly using the -cp option when invoking java.

    Andy

  5. #5
    Join Date
    Mar 2011
    Posts
    4

    Question Dba

    Dear Sir,
    I have created following doc. and the output follows it.
    It is as follows:
    export to indxmlext.text of del
    select
    xmlelement(name "macess_exp_inport_export_file",
    xmlelement(name "file_header",
    xmlelement(name "file_information",
    xmlelement(name "file_purpose", 'MEMBER FOLDER'),
    xmlelement(name "file_description"),
    xmlelement(name "file_source"),
    xmlelement(name "file_external_reference"))),
    xmlelement(name "items",
    xmlelement(name "folders",
    xmlelement(name "folder",
    xmlelement(name "external_reference"),
    xmlelement(name "processing_instructions",
    xmlelement(name "mode", 'UPDATE')),
    xmlelement(name "filing_instructions",
    xmlelement(name "folder_ids",
    xmlelement(name "parent_folder", xmlattributes(n.mbrhs_sub_ssn as "id",
    '19' as "folder_type_id")))),
    xmlelement(name "folder_data",
    xmlelement(name "folder_header",
    xmlelement(name "folder_type", xmlattributes('20' as "id")),
    xmlelement(name "folder_id", n.mbrhs_sub_ssn ||''|| n.mbrhs_ins_rel ||''|| n.mbrhs_cso_fname),
    xmlelement(name "folder_name", n.mbrhs_cso_lname ||';'|| n.mbrhs_cso_fname),
    xmlelement(name "folder_properties",
    xmlelement(name "folder_property", xmlattributes('7' as "folder_property_definition_id",
    'update' as "action"),
    substr(char(n.mbrhs_cso_dob), 6,2) || substr(char(n.mbrhs_cso_dob), 9,2) ||
    substr(char(n.mbrhs_cso_dob), 1,4)
    ),
    xmlelement(name "folder_property", xmlattributes('8' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cad_zip),
    xmlelement(name "folder_property", xmlattributes('9' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cso_lname),
    xmlelement(name "folder_property", xmlattributes('10' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cso_fname),
    xmlelement(name "folder_property", xmlattributes('11' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_ins_rel),
    xmlelement(name "folder_property", xmlattributes('12' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cso_sex),
    xmlelement(name "folder_property", xmlattributes('31' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cad_addr1),
    xmlelement(name "folder_property", xmlattributes('32' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cad_addr2),
    xmlelement(name "folder_property", xmlattributes('33' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cad_city),
    xmlelement(name "folder_property", xmlattributes('34' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cad_st),
    xmlelement(name "folder_property", xmlattributes('35' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_sub_hsn),
    xmlelement(name "folder_property", xmlattributes('36' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_ine_enr_code),
    xmlelement(name "folder_property", xmlattributes('38' as "folder_property_definition_id",
    '21' as cat_id, 'update' as "action"),
    substr(char(n.mbrhs_med_a_dt), 6,2) || substr(char(n.mbrhs_med_a_dt), 9,2) ||
    substr(char(n.mbrhs_med_a_dt), 1,4)),
    xmlelement(name "folder_property", xmlattributes('38' as "folder_property_definition_id",
    '23' as cat_id, 'update' as "action"),
    substr(char(n.mbrhs_med_b_dt), 6,2) || substr(char(n.mbrhs_med_b_dt), 9,2) ||
    substr(char(n.mbrhs_med_b_dt), 1,4)),
    xmlelement(name "folder_property", xmlattributes('38' as "folder_property_definition_id",
    '24' as cat_id, 'update' as "action"),
    substr(char(n.mbrhs_med_d_dt), 6,2) || substr(char(n.mbrhs_med_d_dt), 9,2) ||
    substr(char(n.mbrhs_med_d_dt), 1,4)),
    xmlelement(name "folder_property", xmlattributes('38' as "folder_property_definition_id",
    '25' as cat_id, 'update' as "action"),
    substr(char(n.mbrhs_oic_dt), 6,2) || substr(char(n.mbrhs_oic_dt), 9,2) ||
    substr(char(n.mbrhs_oic_dt), 1,4)),
    xmlelement(name "folder_property", xmlattributes('39' as "folder_property_definition_id",
    'update' as "action"), n.mbrhs_cid_hicn),
    xmlelement(name "folder_property", xmlattributes('42' as "folder_property_definition_id",
    'update' as "action"),
    substr(char(n.mbrhs_eff_dt), 6,2) || substr(char(n.mbrhs_eff_dt), 9,2) ||
    substr(char(n.mbrhs_eff_dt), 1,4)),
    xmlelement(name "folder_property", xmlattributes('43' as "folder_property_definition_id",
    'update' as "action"),
    substr(char(n.mbrhs_curr_termdt), 6,2) || substr(char(n.mbrhs_curr_termdt), 9,2) ||
    substr(char(n.mbrhs_curr_termdt), 1,4)
    )
    )))))))
    as "indxmlext"
    from hs.NewMembExtract n
    ;


    THE OUTPUT IS AS FOLLOW,WHICH IS NOT CORRECT:
    <?xml version="1.0" encoding="UTF-8" ?>
    <macess_exp_inport_export_file>
    <file_header>
    <file_information>
    <file_purpose>MEMBER FOLDER</file_purpose>
    <file_description/>
    <file_source/>
    <file_external_reference/>
    </file_information>
    </file_header>
    <items>
    <folders>
    <folder>
    <external_reference/>
    <processing_instructions>
    <mode>UPDATE</mode>
    </processing_instructions>
    <filing_instructions>
    <folder_ids>
    <parent_folder id="524660349" folder_type_id="19"/>
    </folder_ids>
    </filing_instructions>
    <folder_data>
    <folder_header>
    <folder_type id="20"/>
    <folder_id>524660349EELEWIS</folder_id>
    <folder_name>PETTY;LEWIS</folder_name>
    <folder_properties>
    <folder_property folder_property_definition_id="7" action="update">11131947</folder_property>
    <folder_property folder_property_definition_id="8" action="update">80530 </folder_property>
    <folder_property folder_property_definition_id="9" action="update">PETTY</folder_property>
    <folder_property folder_property_definition_id="10" action="update">LEWIS</folder_property>
    <folder_property folder_property_definition_id="11" action="update">EE</folder_property>
    <folder_property folder_property_definition_id="12" action="update">M</folder_property>
    <folder_property folder_property_definition_id="31" action="update">6294 CLAYTON CIR</folder_property>
    <folder_property folder_property_definition_id="32" action="update"/>
    <folder_property folder_property_definition_id="33" action="update">FREDERICK</folder_property>
    <folder_property folder_property_definition_id="34" action="update">CO</folder_property>
    <folder_property folder_property_definition_id="35" action="update">W32799509</folder_property>
    <folder_property folder_property_definition_id="36" action="update">ACT</folder_property>
    <folder_property folder_property_definition_id="38" CAT_ID="21" action="update"/>
    <folder_property folder_property_definition_id="38" CAT_ID="23" action="update"/>
    <folder_property folder_property_definition_id="38" CAT_ID="24" action="update"/>
    <folder_property folder_property_definition_id="38" CAT_ID="25" action="update"/>
    <folder_property folder_property_definition_id="39" action="update"/>
    <folder_property folder_property_definition_id="42" action="update">01012011</folder_property>
    <folder_property folder_property_definition_id="43" action="update"/>
    </folder_properties>
    </folder_header>
    </folder_data>
    </folder>
    </folders>
    </items>
    </macess_exp_inport_export_file>

    RE: the doc should begin with ?xml, then macess and continue with the fold and /folder, then each folder should continue until all the folders are done. The very last porting should contain; /folder properties, /folder header, /folder data, /folder, /folders, /items, and then /macess...

    cOULD ANYONE TELL ME WHAT i AM DOING WRONg?

    tHANK yOU
    GSP

Posting Permissions

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