Abap-table access via JDBC

Hello,
we have a java-program, that accesses data via jdbc to a mysql-database.
Now we want to migrate the mysql-table to abap-table.
How can we access from the  java-program to theese migrated abap-tables via jdbc?
Regards Oliver

Oliver,
If you want to access those tables from SAP, then you have to use the Java Connectors (
JCO).
Please write the more details abount the java IDE and OS, which you are using I will send you appropriate help.
Thanks

Similar Messages

  • 10G Forms connect to MS Access via JDBC

    A new project requires a 10G Form to connect to MS Access database. I understand 10G no longer connects to Access using ODBC. Will JDBC work? If JDBC can be used does anyone have a "How To" document or examples on how to connect orms 10G to MS Access via JDBC
    Thanks
    Ralph

    I dont think it will work. In 10g forms is going to implement transparent gateways.
    Is there a possibility of getting the data from MS access directly to Oracle database and then connect to Oracle DB from forms ?
    Rajesh Alex

  • WebDynpro Abap MSS: Access via "NULL" object reference not possible

    hi,
    My customer send me the following link to Appraisal Documents (Manager) MSS
    http://server.sap.portal:1810/sap/bc/webdynpro/sap/HAP_START_PAGE_POWL_UI_MSS/
    http://a.imageshack.us/img685/5959/mss3.jpg (logon in Costumer SAP System)
    http://a.imageshack.us/img225/4008/mss4.jpg (Appraisal Documents (Manager) MSS run succesful)
    Link that also run by the SICF in my customer is correct.
    But when I run in my SAP System see the following error
    http://a.imageshack.us/img715/5355/mss1j.jpg (SCIF in my SAP System)
    http://a.imageshack.us/img44/5346/mss2.jpg (SCIF - test service)
    http://a.imageshack.us/img840/1677/mss2b.jpg (Error, without window logon)
    <b> Access via "NULL" object reference not possible</b>
    Other question is:  In what part of MSS is this option? because the ESS is in Career and Jobs / Appraisals Documents
    http://a.imageshack.us/img683/9900/careerjob3.jpg (Employee Self Service / Career and Jobs / Appraisals Documents)
    thanks for your posts and answer
    Ivan

    Hello
    The most important information is (again) missing: which object reference is initial ("NULL")?
    The ABAP dump will tell you.
    Below I show an example how this can happen (and be avoided):
    LOOP AT lt_accountings INTO ls_accounting.
      lo_po_account ?= ls_accounting-accounting.
    ENDLOOP.
    " QUESTION: Are you sure that lo_po_account hold an instance ???
    " If LO_PO_ACCOUNT is empty the following statement will give you the dump.
    ls_mepoaccounting = lo_po_account->get_data( ).
    " And that is how to avoid this (at least the dump. Whether your logic is still ok is another matter...)
    CHECK ( lo_po_account IS BOUND ).
    ls_mepoaccounting = lo_po_account->get_data( ).
    Regards
      Uwe

  • Inserting data into Ms Access via jdbc odbc connectivity

    Can anyone help dictate what's wrong with this below method which is supposed to be adding new record(append) into my ms Access Table. This is giving me a hell of problem, I thought I have everything well. The module is branched via a Swing ui. Can you debug this ? and send a new code to try?
    public void Query3(){
    try{
    //while(rs.next() )
    stmt.executeUpdate("INSERT INTO pupRegister_Table1 " +
         "VALUES ('1001', 'Simpson', 'Mr.', 'Springfield', '2001')");
    //stmt.executeUpdate ("INSERT INTO pupRegister_Table1 " +
    //"VALUES(var_firstname)");
    // Close the result set, statement and the connection
    rs.close() ;
    stmt.close() ;
    conn.close() ;
    } catch( SQLException se )
    System.out.println( "SQL Exception:" ) ;
    Thanks. Note I have done all the DriverManager stuff already and other modules like for displaying the records, do work fine.

    Thanks a lot,
    that contribution really helped but I realised that I Missed adding the
    insertRow();
    that did the trick and it works fine now
    Thanks
    Yet another issue is about inserting the current date into the date field having data type as date. Hence I am using the Jdbc stuff. I am having problem here
    any further help?

  • Internal PLSQL Tables Access via SQL. But how ?

    Hello,
    I want to write the result of a database query in an internal PLSQL Table. After that i would like work with this internal PLSQL Table
    in a Package/Procedure/Function.
    Important for me is to access the internal Table via SQL because i have to refactor a package wich is working with 46 Database Tables an plain SQL. I
    would like to change these DB Tables into internal PLSQL Tables.
    I have written a short example wich will explain my approach to solving this problem.
    The syntax will be accepted by the Database but my 'dbms_output.put_line' statement at the end is empty or blank.
    What do i wrong ? Would be nice if anyone can help me out.
    With best regards
    Jens
    pre work :
    create table PERSON_DB_TABLE
    (SURNAME  VARCHAR2(50),
    LASTNAME VARCHAR2(50));
    insert into PERSON_DB_TABLE values
    ('JENS','FOERSTER');
    insert into PERSON_DB_TABLE values
    ('MAX','MEIER');
    insert into PERSON_DB_TABLE values
    ('MARTHA','MUSTERMANN');
    create type PERSON_OBJECT as object (
        SURNAME  VARCHAR2(50),
        LASTNAME VARCHAR2(50));
    create type PERSON_NESTED_TABLE as table of PERSON_OBJECT;
    now my anonymous block
    declare
       v_PERSON_OBJECT        PERSON_OBJECT;
       v_PERSON_NESTED_TABLE  PERSON_NESTED_TABLE;
       v_PERSON_OBJECT_2      PERSON_OBJECT;
    begin
       for v_counter in (select SURNAME, LASTNAME into v_PERSON_OBJECT.SURNAME,
                                                                                            v_PERSON_OBJECT.LASTNAME
                                  from PERSON_DB_TABLE)
         loop
            v_PERSON_NESTED_TABLE := PERSON_NESTED_TABLE(v_PERSON_OBJECT);
         end loop;
       for v_counter in (select SURNAME, LASTNAME into v_PERSON_OBJECT_2.SURNAME,
                                                                                            v_PERSON_OBJECT_2.LASTNAME
                                  from TABLE (v_PERSON_NESTED_TABLE))
         loop
            dbms_output.put_line(v_PERSON_OBJECT_2.LASTNAME);
         end loop; 
    end;

    1386a7b8-e834-43bf-a0d4-922b548bb70b wrote:
    I need this, because my customer didn't like the idea to use Database Tables instead of Variables in the RAM. So he wants this procedure redesigned.
    As Mike says, keep this person away from your database.
    Customers should not be dictating how to implement technical solutions, they should be providing business and logical requirements.
    PL/SQL arrays/collections use expensive PGA memory, taking up valuable server resources.
    Copying data from the database to PGA memory to try and process it using PL/SQL is bad design.  SQL is designed specifically for data manipulation using database tables, so it's the ideal way to do process data... directly on database tables.

  • Remote database access via JDBC?

    Hello,
    Can anyone give me info on accessing remote databases (i.e. Microsoft
    Access, etc) from Java programs (Servlets, JSP's, Classes) residing on the
    iSeries (AS400) or perhaps any platform?
    I currently have a couple of web applications set up on the Websphere App server that access DB2/400 database and I also have some Java Classes on PC's that access MS Access datafiles. I would like to begin writing the majority of my applications that run on the iSeries (or host system) that can remotely access other databases on our network.
    Any info would be of great help to me.
    Thank you
    Don

    I don't know of any existing Access JDBC drivers that support remote access, after all, the Access database itself is not remote access capable except via file sharing. One possibility is to look for a Type 3 JDBC driver that supports reuse of other Type 1 (ODBC bridge), Type 2 (Java/Native Mix) and Type 4 (pure Java)JDBC drivers on the server side.
    If you were using WebLogic Server, I suppose you could use its remote JDBC facilities, but that won't help you.
    One problem you will have to face is that Access JDBC drivers are not (if I recall) meant to be used in a multithreaded fashion. Good luck. By the way, it might be far simpler to port the Access database to DB2/400.
    Chuck

  • Error in extracting String value from MS ACCESS via JDBC

    Something wierd occurs in my program. I have a ACCESS database table named FormDetail. The attributes are:
    name memo
    val memo
    The actual data store in such a table is
    haihe 2
    String test="SELECT name, val FROM FormDetail";
    rs = stmt.executeQuery(test);
    while(rs.next())
    {  String name = rs.getString("name");
    String value = rs.getString("val");
    System.out.println("name: "+name+" value: "+value);
    When I execute the code, the output is
    name: haihe value:
    NO VALUE print out. Why?
    Any suggestion will be helpful! Thanks!

    Though not using Access myself in the moment, I remember a lot of post about its memo fields.
    Recommend to search for "+access +memo" here.

  • Using IN and TABLE operators via JDBC

    Greetings,
    Hope this may be of benefit to someone.
    Any and all feedback greatly appreciated.
    import java.math.BigDecimal;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.sql.DataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.jdbc.pool.OracleDataSource;
    * Tests an SQL query that uses the IN operator and the TABLE keyword.
    * The TABLE keyword transforms a PL/SQL collection into a regular table.
    * Hence a query can use the IN operator with a PL/SQL collection.
    * A PL/SQL collection maps to a java array.
    * Hence you can execute a query using a <code>PreparedStatement</code> and an
    * array as the parameter value.
    * Note, however, that the PL/SQL collection type <em>must</em> be a database
    * named type, one that is defined using the CREATE TYPE [DDL] statement.
    public class SqlQuery {
      public static void main(String[] args) {
        Connection c = null;
        Object[] oa = new Object[3];
        oa[0] = new BigDecimal("9712061");
        oa[1] = new BigDecimal("9712062");
        oa[2] = new BigDecimal("9712063");
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "select ENAME " +
                       "from EMP " +
                      "where EMPNO in (" +
                                      "select * " +
                                        "from table(?)" +
        String url = "jdbc:oracle:thin:scott/tiger@//localhost:1521/orcl";
        try {
          OracleDataSource ods = new OracleDataSource();
          ods.setURL(url);
          c = ods.getConnection();
          ArrayDescriptor ad = ArrayDescriptor.createDescriptor(
                                                           "<nested table type name>",
                                                           c);
          ARRAY a = new ARRAY(ad, c, (Object) oa);
          ps = c.prepareStatement(sql);
          ps.setArray(1, a);
          rs = ps.executeQuery();
          while (rs.next()) {
            System.out.println(rs.getString(1));
        catch (Exception x) {
          x.printStackTrace();
        finally {
          if (rs != null) {
            try {
              rs.close();
            catch (Exception x) {
              System.err.println("Failed to close result set.");
              x.printStackTrace();
          if (ps != null) {
            try {
              ps.close();
            catch (Exception x) {
              System.err.println("Failed to close statement.");
              x.printStackTrace();
          if (c != null) {
            try {
              c.close();
            catch (Exception x) {
              System.err.println("Failed to close database connection.");
              x.printStackTrace();
    }Good Luck,
    Avi.

    Thanks a lot for your replies!
    We've solved the issue by converting the de table of record type into a sys_refcursor.
    The types are now defined globally (instead of in a package) and we wrote a wrapper around the original function:
    create or replace type my_result_rec as object(
      val1 number,
      val2 number );
    create or replace type my_result_tab is table of my_result_rec;
    function my_function_wrapper(
        param1 in number,
        param2 in number
      ) return sys_refcursor is
        result sys_refcursor;
      begin
        open result for
          select * from table(my_function(param1,param2));
        return result;
      end;
    Rob

  • Doubt Regarding Table Accessed via DB Link

    I have the following SQL:
    select * from tab1@db_link tab1, tab2
    where tab1.col1=tab2.col2
    and tab1.col2=99;
    Can I ensure that Oracle brings data corresponding to:
    select * from tab1@db_link tab1
    where tab1=99;
    and then joins the data with tab2.
    What could be fastest way to access data in this manner? Basically i need to tune a similar query.

    No not much difference. On both the cases oracle goes for the same plan. Here is a small test case
    select t.*
      from t@to_inlabnew t, t1
    where t.object_id = t1.object_id
       and t.object_type = 'TABLE'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.03       0.16          0          0          1           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch      171      1.09       1.68          0          6          0        2544
    total      173      1.12       1.84          0          6          1        2544
    Rows     Execution Plan
          0  SELECT STATEMENT   GOAL: ALL_ROWS
       2544   HASH JOIN
       1000    INDEX   GOAL: ANALYZED (FAST FULL SCAN) OF 'T1_IDX' (INDEX)
    199792    REMOTE OF 'T' (REMOTE)
                   [TO_INLABNEW.REGRESS.RDBMS.DEV.US.ORACLE.COM]
                  SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID",
                  "DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME",
                  "TIMESTAMP","STATUS","TEMPORARY","GENERATED","SECONDARY" FROM
                    "T" "T" WHERE "OBJECT_TYPE"='TABLE'
    select t.*
      from (select * from t@to_inlabnew where object_type = 'TABLE') t, t1
    where t.object_id = t1.object_id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch      171      1.09       1.46          0          6          0        2544
    total      173      1.09       1.46          0          6          0        2544
    Rows     Execution Plan
          0  SELECT STATEMENT   GOAL: ALL_ROWS
       2544   HASH JOIN
       1000    INDEX   GOAL: ANALYZED (FAST FULL SCAN) OF 'T1_IDX' (INDEX)
    199792    REMOTE OF 'T' (REMOTE)
                   [TO_INLABNEW.REGRESS.RDBMS.DEV.US.ORACLE.COM]
                  SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID",
                  "DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME",
                  "TIMESTAMP","STATUS","TEMPORARY","GENERATED","SECONDARY" FROM
                    "T" "T" WHERE "OBJECT_TYPE"='TABLE'

  • Database access via Jdbc  in JSP

    Hey guys,
    Need a help here..I want to compare a data to existing data in a table sequencially.
    1)re is the example, if i have a user login prog,i want to compare the user already exists in that data table.
    if so how can print the user id's to compare?
    and 2)at if the user id is a wave file(binary data) in SQl? since its immposible to compare the binary data?
    keep me posting,thanks

    1. Well, perform a query.
    2. Who says you can't compare "binary" data?

  • How to handle BLOB field in receiver JDBC adapter into ABAP table

    Dear Experts,
    I am working in a synchronous scenario with Sender ABAP Proxy to Oracle Database as receiver via SAP PO 7.4.I will be calling a stored procedure view with fields ID, NAME,Age,*** and BLOB (Image binary).
    1. The response from Oracle Database field BLOB is to be stored in ABAP table.Would I have to write any JAVA program to read the BLOB or the receiver JDBC adapter will handle it and store in a table by using ABAP proxy once it reaches ECC.
    2. If yes, would the JAVA program have to deal with other 4 fields.
    3. Can I use a UDF mapping to this BLOB field.
    Regards
    Rebecca...

    Dear Praveen,
    Thanks for your response...
    Please correct me if I am wrong.
    1. For 1-1 response mapping for BLOB field, I will use just use the below UDF code.
    public static byte[] hexStringToByteArray(String s) { 
                int len = s.length(); 
                byte[] data = new byte[len / 2]; 
                for (int i = 0; i < len; i += 2) { 
                            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) 
                                                                                         + Character.digit(s.charAt(i+1), 16)); 
                return data; 
    2. ===Using the byte data, create binary attachment in mapping for abap proxy response===
    Could you please share how to create the binary attachment.. I am not clear
    Regards...

  • Lost index stats in Ora 8.1.6 Tables when selecting via jdbc

    Hi,
    i'm using JBuilder8 and Kylix2 on a Linux machine with Oracle oci drivers of client 8.1.7.
    The connect through JB8 jdbc via DBPilot is succesful and shows the tables of the db.
    After executing a select on any table the index stats of this table are lost.
    Kylix works fine without this failure.
    Thanks for any comments to this problem
    Jens

    Well, it's not the PL/SQL code that is causing a problem. Everything worked fine for many months. Then one day (without any changes in the environment or code) the update of a table from a java application (via JDBC) fails. The same update done directly on the DB with SQL Plus still succeeds!
    This led us to think that something is wrong with the JDBC connection (which was up for several months). Maybe a memory corruption?
    Anyone that experienced similar problems with JDBC?

  • Access ABAP Table using Java (NWDS/JCO)

    All,
    I am trying to setup a jco connection from java program through NWDS to ECC abap table.
    However I am getting the following error in NWDS:
    Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [C:\Program Files\Java\jdk1.6.0_45\bin\sapjcorfc.dll: Access is denied]. java.library.path [C:\Program Files\Java\jdk1.6.0_45\bin;.]
    and a parity error on my system:
    "Parity blocked an attempt by javaw.exe to run sapjcorfc.dll because the file is not approved.  If you require access to this file, please contact your system administrator.  Scroll down for diagnostic data."
    Here is the Java code...per the SAP website:
    package com.sap.pi.updateAbapSxmbAdminParams;
    import com.sap.mw.jco.*;
    public class ReadPiAbapTables {
      private static JCO.Client theConnection;
      private static IRepository theRepository;
      public static void main(String[] args) {
       createConnection();
       retrieveRepository(); 
       try {
        JCO.Function function = getFunction("RFC_READ_TABLE");
        JCO.ParameterList listParams = function.getImportParameterList();
        listParams.setValue("BSAUTHORS", "QUERY_TABLE");
        theConnection.execute(function);
        JCO.Table tableList = function.getTableParameterList().getTable("SXMSCONFVLV");
        if (tableList.getNumRows() > 0) {
         do {
          for (JCO.FieldIterator fI = tableList.fields();
          fI.hasMoreElements();)
           JCO.Field tabField = fI.nextField();
           System.out.println(tabField.getName()
             + ":t" +
             tabField.getString());
          System.out.println("n");
         while (tableList.nextRow() == true);
       catch (Exception ex) {
        ex.printStackTrace();
      private static void createConnection() {
       try {
        theConnection = JCO.createClient("aaa", "aaa", "aaa", "aa", "aa", "aa");
        theConnection.connect();
       catch (Exception ex) {
        System.out.println("Failed to connect to SAP system");
      private static void retrieveRepository() {
       try {
        theRepository = new JCO.Repository("saprep", theConnection);
       catch (Exception ex)
        System.out.println("failed to retrieve repository");
      public static JCO.Function getFunction(String name) {
       try {
        return theRepository.getFunctionTemplate(name.toUpperCase()).getFunction();
       catch (Exception ex) {
        ex.printStackTrace();
       return null;

    Hi Vicky,
    You need authorization to the S_TABU_DIS object, talk with the ABAP basis team about this to find the more restrictive role.
    It's not a good idea to use the RFC_READ_TABLE, for the wide permissions needed. You could think to develop a Z RFC for this.  You can check pros/cons in this document: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a83ec690-0201-0010-14ac-bd1d75e24a7d?overridelayout=t…
    Regards.

  • Access ABAP table in Webdynpro Java application

    Hi All
    Is it possible to access ABAP table in Webdynpro Java application
    Please provide your input
    Thanks
    Karthi D.

    Hi you will connect to the remote SAP system, the
    backend, using an Adaptive RFC MOdel. To access database tables, you can make use of existing functions in terms of RFC function modules. For each function module you need, the system generates a corresponding Java proxy class. All the generated proxy classes and interface are bundled together in the RFC model and treated as part
    of your Web Dynpro project
    In WebDynpro java you RFC by using Model :
    Adaptive RFC Model
    1. automatically adapts to changes in function module signature
    2 provides support for data types and extensibility
    3.support for different structure definitions in different backend
    systems (release dependent structures, custom adaptation)
    Basic principles and guidelines
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de
    See this blog
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2brfc
    http://help.sap.com/saphelp_nw04s/helpdata/en/6a/11f1f29526944e8580c5e59333d96d/frameset.htm
    Thanks,
    Tulasi

  • Problem with Web Dynpro ABAP Adobe form Access via 'NULL' object reference

    Hi All!
    I'm a beginner of Adobe form.
    problem 1:
    I tried to display data in Adobe interactive form according to the tutorial :https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7783. [original link is broken] [original link is broken] [original link is broken]
    I checked every step, but unfortunately it reported an error: Access via 'NULL' object reference not possible. I found that the error happens when trying to get element of the context node.
    I also have such problem when I was studying the tutorial https://wiki.sdn.sap.com/wiki/display/WDABAP/CallAdobeFormthroughABAPWebDynpro.
    problem 2:
    I can't input any data in input box or click any button even  if I selected the property 'enabled' of the interactive form while my colleague can do it on his computer.  Does it means that there are some thing wrong with my adobe reader?
    Hope anyone could save me,
    Thanks & Regards,
    Murloc

    >
    tomcat123 wrote:
    > Hi All!
    > I'm a beginner of Adobe form.
    > problem 1:
    > I tried to display data in Adobe interactive form according to the tutorial :https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7783. [original link is broken] [original link is broken] [original link is broken]
    > I checked every step, but unfortunately it reported an error: Access via 'NULL' object reference not possible. I found that the error happens when trying to get element of the context node.
    > I also have such problem when I was studying the tutorial https://wiki.sdn.sap.com/wiki/display/WDABAP/CallAdobeFormthroughABAPWebDynpro.
    Check that you have entries in the Table MARI. else you will get this message.
    > problem 2:
    > I can't input any data in input box or click any button even  if I selected the property 'enabled' of the interactive form while my colleague can do it on his computer.  Does it means that there are some thing wrong with my adobe reader?
    >
    Compare the adobe live cycle version. it will work fine with 7.0/7.1
    > Hope anyone could save me,
    > Thanks & Regards,
    > Murloc

Maybe you are looking for

  • How we can configure new pricing procedure at the time of billing document

    Hi SD Gurus, Can u plz tell me how we can configure new pricing procedure at the time of billing document level. Thanks & Regards, Sreenivas.P

  • Allowing Digital signatures for Reader

    I've come across an issue that I have not been able to figure out. I have created a pdf on my computer which has Acrobat X. Within my document I have portions where there are digital signature. Now I can sign the blocks when I use my computer, but wh

  • Getting iPhone notes off the iPhone since Mountain Lion

    Before Mountain Lion, I used to be able to access the notes on my iPhone from the sidebar in Mail. That way, I could copy-paste something I had been writing during the day or on the bus and take it into Word or whatever. Then, I could re-sync the pho

  • Photo library occupy big storage

    this is not the issue related to iTunes! in the storage usage, there are four items for the Photos&Camera: Photo library (2.1GB), synced from iTunes Library (0.8kb), My photo stream (181mb), Shared Photo Stream(20.4MB). I can not figure out what the

  • The Adobe Forms was created with Disable Fields!

    Hi All, I am new in Adode Interactive Forms ABAP.  I am trying to implement a simple scenario using Web Services published by RFC on ABAP side and simple form with one field  MATNR to bring a Description MARKT, and button to call the Web Services.  I