Accessing DB2 data through DBLINK in Java program recieves ORA-02063 error

Hello,
Is it posible to access a mainframe DB2 table through a Java JDBC connection utilizing a DBLink / Synonym. Using Toad or SQLDeveloper, I can select the DB2 data just fine. Also, PL/SQL programs can access the data without issues. When I try to select data from the DB2 Table in a Java program, I get ORA-01002: fetch out of sequence -- ORA-02063 preceding line from DB2D errors.
The code I am using to test is:
(Note: TBL_LOC_ADR is the Synonym that points to the Mainfram DB2 table)
public static void main(String[] args) {
          Connection con = null;
          Statement stmt = null;
          String query = "SELECT * FROM tbl_loc_adr";
          ResultSet rs;
          try {
               System.out.println("Getting connection");
               con = BatchDBConnection.getDBConnection();
               TestConnection tc = new TestConnection();
               System.out.println("Creating ps");
               stmt = con.createStatement();
               System.out.println("Calling qds");
               rs = stmt.executeQuery(query);
               System.out.println(" Returned data " );
          } catch (Exception e) {
               System.out.println("Error " + e.getMessage());
               e.printStackTrace();
The error occurs on the rs = stmt.executeQuery(query); line.
Thanks for any input into this error. It's been driving me nuts all day.
Chris

Chris,
What's your oracle version? You might be hitting a bug as identified in this metalkink doc id, see if this helps out. Resolution posted in the metalink by applying patches or confirm that you have applied all the required patches.
Doc ID: 456815.1 ORA-01002 ORA-2063 When Profiling DB2/400 Table Accessed by View via Transparent Gateway for DRDA
Regards

Similar Messages

  • How do I access session data through an EJB?

    Hi
    How do I access session data through an EJB?
    I am currantly developing a Web service (using ejb's, JBoss.net and Apache Axis). A client making a call to this Web service, is expecting a bussiness-object in return. My problem is that this bussiness-object i stored in a users session data. How do I retrieve this bussiness-object from the users session.
    I have read that this does not work with httpsessions, is this true? If this is true, is it possible to store the bussiness object in a JavaBean e.g:
    <jsp:useBean id="userContextWebImpl" scope="session" class="com.ac.march.client.UserContextWebImpl">
    <%
    String key = "test";
    String value = "This is the value";
    userContextWebImpl.setValue( key, value1 );
    %>
    </jsp:useBean>
    and then retrieve this information through the EJB? Or is it possible to do this by using Statfull JavaBeans? Or can this be done through a nother solution?
    Please help!

    I have created a JavaBean with scope="application" to store some data. The data is stored when a user prefomes a spesific task.
    A different person then makes a call to a Web-Service on the server. The Web-Service then asks an EJB to retrieve the data stored in the JavaBean (servlet cotext). In other words: How do I retrieve this data from the EJB?
    I have tried with this code, but with no luck.
    (ApplicationContextWebImpl is the JavaBean)
    public static String getBookingResult( String key )
         String myResult = null;
         String myKey = key;
         ApplicationContextWebImpl applicationContextWebImpl = null;
         try
              applicationContextWebImpl = new ApplicationContextWebImpl();
              myResult = (String)applicationContextWebImpl.getValue( key );
         catch ( java.rmi.RemoteException e )
         return myResult;
    }

  • Access the adobe form pdf data in abap or java programs

    Hi,
    We created an adobe form, with few text boxes, and emailed to user for filing his data into the pdf file.
    He filled the text boxes and saved the pdf, and sent back the pdf file by mail.
    Now our requirement is:
    we need to read the values entered by the user in pdf and update in certain ztables using abap or java.
    case 1: using abap
    How can abap program read the entries/values in pdf.
    is there any doc/blog that shows how to access the adobe form data in abap.
    do we need to use/install any software for this.
    case 2: using java
    Is it possible to read/retrive the adobe form data into java. once the data is into java program, i can utilise the data for several puposes.

    using ABAP:
    check the program: FP_PDF_TEST_03
    This program reads the data from Adobe into XML format.
    After this you have to read the data from XML format into ABAP(hope you know how to convert XML to ABAP or simply google it).
    Thanks,
    Chandra

  • How do you access things like volume in a java program

    I want to access the volume on a computer with a java program. How does one do this?

    Are you saying that you need to add rows to a table in DB2 via a Java program? If so, you need to look at the JDBC API, (available on this site along with a bunch of tutorials). If not, post again with a clearer description of your problem.

  • CAN i CALL OLAP DML THROUGH JDBC IN JAVA PROGRAM

    I HAVE ORACLE V 9.2.0.1.0 AND AFTER CREATING A CUBE FROM ENTERPRISE CONSOLE I HAVE TO GO WITH EITHER SQL PACKAGES OR OLAP DML PROGRAMS ,SO PLS GIVE ME PROPER WAY AND LINK OF SOURCES TO WORK WITH OLAP DML IN JAVA PROGRAMS
    CAN I USE AS PREPARED STATEMENT OR CREATE STATEMENT IN JAVA
    TO CALL OLAP DML? BECAUSE NORMALLY WE MUST USE OLAP WORKSHEET TO EXECUTE OLAP COMMANDS
    Message was edited by:
    user594151

    The access OLAP objects via Java you have two options. You can code directly against the OLAP API and I think someone has already provided you with the link to the supporting documentation. The OLAP API docs provide worked examples on access OLAP metadata and retrieving OLAP data. However, this is extremely low level coding. An alternative is to use the Business Intelligence Beans. Oracle Business Intelligence Beans enables developers to productively build business intelligence applications that take advantage of the rich OLAP functionality in the Oracle database. OracleBI Beans includes presentation beans - graph and crosstab, data beans - query and calculation builders and persistence services, which may be deployed in both HTML client and Java client applications. OracleBI Beans is seamlessly integrated into Oracle JDeveloper to provide the most productive development environment for building custom BI applications. For more information goto the the BI Beans home page
    http://www.oracle.com/technology/products/bib/index.html
    Specifically on executing OLAP DML see the following example:
    Developing a Dashboard Application with Oracle BI Beans:
    http://www.oracle.com/technology/products/bib/1012/viewlets/MS%20Developing%20Executive%20Insight.html
    Adding controls to execute OLAP DML      This viewlet demonstrates how to quickly and easily add the controls to execute OLAP DML models that can be executed to update the What If presentation.
    http://www.oracle.com/technology/products/bib/1012/viewlets/Pages/What_If_Analysis_Part_4_viewlet_swf.html
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • How to access database file on CDROM from Java Programe??

    Hello friends,
    I am making online exam application.
    I want my question database to be reside on CDROM.
    but i am not getting any idea how to make DSN or static path that resolute the path that i have mentioned for CDROM.
    basically i want to know how to access CDROM from Java Programe????
    Thanks in advance
    Navik Pathak

    Once you mounted the CDROM (something maybe as /media/cdrom) as a file system (or assigned a drive letter to it like D: or F: or whatever), the files are accessible normally.

  • How to access archived data through queries

    Hi,
    I would like to know if there is any way to access the archived data through SAP query. I don`t have any infostructure for this archived data.

    You mean mails once present and readable on the iPad, but no longer there (in the, by default, 50-long mail list)?

  • Unable to connect to ECC system through stand alone JAVA program using JCO.

    Hi All,
    I want to connect to ECC system through standalone JAVA program using jco.while executing my java program it is saying that connection refused.
    I am getting the error as shown below.
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CMALLC : rc=20 > Co
    nnect from SAP gateway to RFC server failed
    Connect_PM  GWHOST=192.168.10.99, GWSERV=sapgw01, SYSNR=01
    LOCATION    SAP-Gateway on host igm501 / sapgw01
    ERROR       partner '192.168.10.99:sapgw01' not reached
    TIME        Mon Sep  1 15:00:37 2008
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -10
    MODULE      nixxi.cpp
    LINE        2821
    DETAIL      NiPConnect2
    SYSTEM CALL connect
    ERRNO       239
    ERRNO TEXT  Connection refused
    COUNTER     2
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:11
    25)
            at com.sap.mw.jco.JCO$Client.connect(JCO.java:3138)
            at JConnector_frmDesk.<init>(JConnector_frmDesk.java:91)
            at JConnector_frmDesk.main(JConnector_frmDesk.java:141)
    I have already configured SAPDP01,SAPGW01 in my services file in windows\system32\drivers\etc\services.
    What else i need to do to connect to ECC system through my JAVA program.Please help me in this regard.
    Regards,
    Ramana.

    Hi !
    Check this to verify that you are correctly using JCO:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Try to give in ashost="/H/saprouter/H/sap".
    Regards,
    Matias.

  • I am getting ORA-02063 error while copying bulk data from DBLINK

    Hi all ,
    I am trying to copy data from DBlink ,whenever i am trying to pull more data ,The db link break down ,
    I have try to put /*+ APPEND */  (Hint) in insert statement.Below is the insert code from my procedure
    from where i am getting below error
    "Error in copy_data_pkg-3113 ORA-03113: end-of-file on communication channel
    ORA-02063: preceding line from TESTDBLINK"
    Insert code:
    INSERT /*+ APPEND */ INTO target_tab
    select
    col1,
    col2,
    col3,
    col4,
    col5,
    o_time
    FROM padmin.V_tab1@testdblink
        where
    trunc (sysmodtime) = trunc(sysdate)-1
    and O_time >= al_time
    and (CLEAR_TIME is null or  CLEAR_TIME >= occur_time)
        and (res_code is null or (UPPER(res_code) not LIKE '%TEST TT%' and UPPER(res_code) not LIKE '%TEST SITE%'))
        and ((UPPER(BRIEF_DESC) not like '%TEST TT%' and UPPER(BRIEF_DESC) not LIKE '%TEST SITE%'))
        and (o_time+(330/(24*60))) <= trunc(SYSDATE)-1/24/60/60
        and  catvar IN('POS')
      and UPPER(action_var) not like '%SC_NET%' and UPPER(action) not like '%ROAM_NET%' and UPPER(action) not like '%PUP_NET%';
      COMMIT ;
    Please suggest me ,why i am getting this error.

    Can you elaborate the thing... I don't think  /*+ APPEND */ this is working for me ,still I am getting same error.
    If you have any other suggestion,I would like to hear.
    Should i not put commit after some 500 records inserted ? As i am putting commit once after whole data gets inserted.

  • Help: Transfer of data via DBLink from 10g to 8i (ORA 02068)

    Hello,
    I read many threads on this issue, either in OTN or Metalink.
    We have an old 8i DB (8.1.7.1.0) that we still use, and a brand new 10gR2 DB ...
    - The 8i is with character set UTF8
    - The 10g is with character set AL32UTF8
    I create a DBLink in the 8i DB...
    When I only try to select 10g data from the 8i DB... I get error :
    - ORA-02068: following severe error from my10gDB
    - ORA-24365: error in character conversion
    From the different notes I saw, there is a problem because of the 8i DB version and its character set. I accept this as a statement.
    Furthermore, we cannot ask for any upgrade or change of our 8i DB.
    So, my question is there any work around that I can use ?
    I firstly did this, on one of the tables to transfer ... :
    -1) extract the 10g data into a file
    -2) transfer the file into the 8i Unix machine
    -3) insert the data from the file into the 8i DB.
    but it seems a long process and I don't know how to automatize this idea !!!
    and I feel stuck !Do you have any advice that could make this data transfer easier ?
    Thanks a lot,
    Olivier

    for the performance side direct path read and write and buffer sizes may help, how do you unload the data?
    Below you will find a shell script to handle a similar task for two databases which are in the same server using unix pipes(if disk space is limited this also helps) -
    #!/bin/ksh
    PATH=...
    ORACLE_BASE=...
    ORACLE_HOME=..
    NLS_LANG=..
    NLS_DATE_..
    ORA_NLS32=..
    ORA_NLS33=..
    export PATH ORACLE_BASE ...
    cd /export/home/oracle/...
    for i in $(cat set1.tables)
    do
    /usr/sbin/mknod mknod.$i p
    export ORACLE_SID=FROM-DB
    /u01/app/../some-unloader user/passwd data=mknod.$i table=$i delim='~' trunc=y control=$i.ctl bad=$i.bad TERMINATED=y DATEFMT='dd/mm/yyyy hh24:mi:ss' recsep='|' buffer=1048576 &
    /usr/bin/sleep 1
    export ORACLE_SID=DEST-DB
    /u01/app/oracle/.../bin/sqlldr user/passwd readsize=1048576 control=$i.ctl direct=y log=$i.log bad=$i.bad
    /usr/bin/rm mknod.$i
    done
    Best regards.

  • Trying to query data from a view - ORA-01882 and ORA-02063 Errors

    Hey there,
    I tried to query data from a view that was provided by a colleague. This view works fine and gives correct data using PL/SQL Developer or SQLPLUS, but in SQL Developer, I get the following error:
    ORA-01882: Time zone region not found
    ORA-02063: preceding line from SYSTOOLS
    01882.00000 - "timezone region %s not found"
    * Cause: Specified reason name was not found
    * Action: Please contact Oracle Customer Support
    Vendor Code 1882
    Where comes this error message from?! SYSTOOLS is the database link.
    Can't see an obvious reason for this error.
    OS is Windows 2000 SP4, SQL Developer is v1.1.1.25 BUILD MAIN-25.14
    Regards,
    Thomas

    From Oracle Messages 'Cause and Action'
    http://www.oracle.com/technology/products/designer/supporting_doc/des9i_90210/cmnhlp72/messages/ora_messages.htm
    ORA-01882, 00000, "timezone region %s not found"
    Cause: The specified region name was not found.
    Action: Please contact Oracle Customer Support.
    Maybe invalid region in NLS_LANG?
    "select * from v$nls_parameters"
    Starting this script in all developer program and compared result...

  • Java.sql.SQLException: ORA-00933: error when  executing query

    Hello,
    I am trying to execute the following query from a jsp page.
    String sqlUpdate ="UPDATE table_name SET name ='"+name+"', description='"+description+"', proj_link='" projlink"', active='" active"',sort_order='" order"',image='" image"',category='" category"', technology='" technology "' WHERE id="+id+" ";
    stmt.executeQuery(sqlUpdate);
    I get the follwoing error java.sql.SQLException: ORA-00933: SQL command not properly ended
    When I omit "description" from the query it executes fine. But when I place it back into the query I get the above error. The table is in Oracle database and the datatype of description id varchar2(4000). I declared all the variables used in the query, I then assigned values caught from the form and then am trying to update the form varibles in the table.
    Thanks,
    Nikky128

    Nikky128 wrote:
    Hello,
    I am trying to execute the following query from a jsp page.There's a big part of your problem. You shouldn't be doing database stuff in JSPs. If you must, you should be using JSTL and its <sql> tags.
    String sqlUpdate ="UPDATE table_name SET name ='"+name+"', description='"+description+"', proj_link='" projlink"', active='" active"',sort_order='" order"',image='" image"',category='" category"', technology='" technology "' WHERE id="+id+" ";Not using PreparedStatement here is just a silly noob error.
    When I omit "description" from the query it executes fine. But when I place it back into the query I get the above error. The table is in Oracle database and the datatype of description id varchar2(4000). I declared all the variables used in the query, I then assigned values caught from the form and then am trying to update the form varibles in the table.Probably a single or double quote that you can't see. PreparedStatement will eliminate that problem.
    %

  • How to Access the Systems ipaddress in a java program

    Hi
       In a network The ip addresses of every system is changing.So that i want to know the ipaddresses of the system dynamically.
       I want a client program to  do that.
    And also i want to kno how to create a .exe file for java
    class file

    Hi
    In order to find the IP address of a system dynamically through a java programme Here is code...
        import java.net.*;
        public class check{
         public static void main(String args[])
                  try
    { InetAddress addr = InetAddress.getLocalHost();
        String ipaddress_as_text =addr.getHostAddress();
        System.out.println(ipaddress_as_text);
            catch(Exception ex){}
      For the 2 question ie to convert a .class file to a
    .exe file there are some tools available...
    I think the following link will be useful to you.
           http://duckware.com/jexepack/index.html 
        Thank you....

  • Accessing Webrfc Data through SAPui5.

    Hi Experts.
    I am facing a problem in Accessing the Webrfc (Json) data from SAP, I have created a WebRFC which return the Data into Json format when calling from Browser.
    Json is :
    { "itab" : [{"name" :"Faraz","age" :"26"},{"name" :"Sateesh","age" :"26"},{"name" :"Sahil","age" :"20"}] }
    The problem is i am not able to bind it into SAPUi5 Table. The table is empty.
    The code is as follows.
    // define the Table columns
          var arr =   $.ajax({
         type: 'GET',
         url: 'http://socwes1er198.solutions.glbsnet.com:8000/sap/bc/webrfc?sap-client=950&_FUNCTION=ZTEST_WEBRFC&_NAME=_NAME',
         contentType : "application/json",
         success: function(data) {
           var oModel_Projects = new sap.ui.model.json.JSONModel();
             oModel_Projects.setData({modelData: data});
             alert("Success");              
          var oTable = new sap.ui.table.Table({ 
                    title : "Simple Table", 
                    visibleRowCount : 8, 
                    selectionMode : sap.ui.table.SelectionMode.Single, 
                    navigationMode : sap.ui.table.NavigationMode.Paginator, 
               oTable.addColumn(new sap.ui.table.Column({ 
                      label : new sap.ui.commons.Label({ 
                                text : "Name" 
                      template : new sap.ui.commons.TextView().bindProperty("text", "name"), 
                      width : "50px" 
               oTable.addColumn(new sap.ui.table.Column({ 
                      label : new sap.ui.commons.Label({ 
                                text : "AGE" 
                      template : new sap.ui.commons.TextView().bindProperty( 
                                          "text", "age"), 
                      width : "50px" 
            //Create a model and bind the table rows to this model   
                    var oModel1 = new sap.ui.model.json.JSONModel(); 
                    //Get the forecastday array table from txt_forecast object   
                    var aData = oModel_Projects.getProperty("/itab"); 
                    oModel1.setData({modelData : aData}); 
                    oTable.setModel(oModel1); 
                    oTable.bindRows("/"); 
                    oTable.placeAt('content'); 

    Chris,
    What's your oracle version? You might be hitting a bug as identified in this metalkink doc id, see if this helps out. Resolution posted in the metalink by applying patches or confirm that you have applied all the required patches.
    Doc ID: 456815.1 ORA-01002 ORA-2063 When Profiling DB2/400 Table Accessed by View via Transparent Gateway for DRDA
    Regards

  • Accessing Iteration Dates through REST API

    How should I go about getting the start and end dates for an iteration through the API?
    If I attempt to access the iteration directly (using the URL retrieved by /_apis/wit/classificationnodes/iterations/{parent}&$depth=2) I receive a 'Node ID is not recognized' error:
    "$id": "1",
    "innerException": null,
    "message": "TF51541: The Node ID is not recognized.",
    "typeName": "Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingTreeNodeNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
    "typeKey": "WorkItemTrackingTreeNodeNotFoundException",
    "errorCode": 0,
    "eventId": 3200
    Is there another mechanism for getting this data?

    Hi Steve,
    Thanks for your post.
    We can get the Iteration using general TFS API, it also works with VSO, please refer to the replies in this post:https://social.msdn.microsoft.com/Forums/en-US/6e6a8c5a-bb2a-4b51-9a43-df3c06448f1b/get-sprint-details-from-tfs?forum=tfsgeneral
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • MacBook crashes regularly

    Hello there, hopefully somebody can point me in the right direction. My MacBook (Purchased May 2006) crashes at least twice a day, especially when I am working. What's really annoying is that when I boot into Windows or Linux (Yellow Dog) it never cr

  • 3.1 Changes input on ext instr trcks

    3.1 changes my saved input settings on ext instr mono tracks, to randomly new input when opened. (As an exsmpl: Saved with input 9 and 11 on two trcks, MS changes it to i8 and i10 when I open the Concert again). I have saved (cmdE) both the patch and

  • Is it normal when physical Memory running high all time ?

    Dear Expert We have server production running apex application. Data & Fact OS : windows server 2008 R2 standard (64 bit) intel xeon RAM : 4 GB installed product: DB : Oracle 11g R2 APEX : APEX 4.1 listener : OHS on resource monitor Used Physical Mem

  • How to create ear using Jdeveloper9i

    Hello My Application contains 1) Struts 2) Value objects (WEB layer and ejb Layer acess these classes) 3) EJB Layer Where to place Value objects( in .jar? or in .war) and how to make war, jar and ear using JDeveloper9.0.3

  • Session not avalable between two requests

    I am developing a shopping application. I have a servlet which dispatches to a jsp after processing a request. For every request a new session is being created. I am not sure if i am overlooking anything. Can anyone point me to what i am overlooking.