Accessing an Table in Java

Hi,
I'm getting an error
"java.sql.SQLException: Invalid name pattern: SCOTT.Point"
when I try to access the values of an table with user defined types in a Java stored procedure with getArray().
Here's a more detailed description:
I have defined two "SQL types of language java".
The definition in SQL is:
TYPE Point AS OBJECT EXTERNAL NAME
objects.Point' LANGUAGE JAVA USING SQLDATA (
x FLOAT EXTERNAL NAME 'x',
y FLOAT EXTERNAL NAME 'y',
z FLOAT EXTERNAL NAME 'z');
TYPE Triangle AS OBJECT EXTERNAL NAME
'objects.Triangle' LANGUAGE JAVA USING SQLDATA (
A POINT EXTERNAL NAME 'a',
B POINT EXTERNAL NAME 'b',
C POINT EXTERNAL NAME 'c');
The equivalent java class for Point and Triangle can be found at the end of the posting.
After that I wanted to add a static java function to another class TEST. This function should have an array of triangles as input and should be able to access all the triangles.
Therefor I defined a SQL type for a table of triangles
TYPE mylist AS TABLE OF Triangle;
and a SQL type with the static function that corresponds to the java class TEST:
TYPE test AS OBJECT EXTERNAL NAME
'objects.Test' LANGUAGE JAVA USING SQLDATA (
STATIC FUNCTION testfunction(tri mylist) RETURN NUMBER
EXTERNAL NAME 'testfunction(oracle.sql.ARRAY) return int');
Now the most important - and probably wrong - code:
In the equivalent java class TEST I tried to access the array/table with the following function:
public static int testfunction(oracle.sql.ARRAY trilist) throws SQLException
int n = trilist.length(); // this works !!!!
ARRAY obs = trilist.getArray(); // this doesn't work !!!
Object[] obs = (Object[]) trilist.getArray(); // this doesn't work either
return n;
When I try to use this function in SQLplus, I get this error: "java.sql.SQLException: Invalid name pattern: SCOTT.Point" although I imported the java classes objects.Point and objects.Triangle.
It looks like that there is no problem with the class Triangle, but only with the class Point?!
I really tried a lot and search a lot in forums. But there are hardly any postings to this "server-side" problem, especially with tables of user-defined types. Most of the questions concern accessing data from client-side e.g. create a connection in the java programm and so on...
I would be very thankful to a small example how to be able to access the values of the triangle table or to get a good advice how to solve my problem.
Thanks to you all!
Java classes Point and Triangle:
package objects;
import java.sql.*;
public class Point implements java.sql.SQLData {
public double x;
public double y;
public double z;
public void readSQL(SQLInput in, String type) throws SQLException {
x = in.readDouble();
y = in.readDouble();
z = in.readDouble();
public void writeSQL(SQLOutput out) throws SQLException {
out.writeDouble(x);
out.writeDouble(y);
out.writeDouble(z);
public String getSQLTypeName() throws SQLException {
return "SCOTT.Point";
public Point(){ }
public Point(double x, double y, double z){
this.x = x;
this.y = y;
this.z = z;
package objects;
import java.sql.*;
import objects.*;
public class Triangle implements java.sql.SQLData {
public Point a;
public Point b;
public Point c;
public Vector normal;
public void readSQL(SQLInput in, String type) throws SQLException {
a = (Point) in.readObject();
b = (Point) in.readObject();
c = (Point) in.readObject();
public void writeSQL(SQLOutput out) throws SQLException {
out.writeObject(a);
out.writeObject(b);
out.writeObject(c);
public String getSQLTypeName() throws SQLException {
return "SCOTT.Triangle";
public Triangle(){ }
public Triangle(Point a, Point b, PointD c, Vector normal)
this.a = a;
this.b = b;
this.c = c;
this.normal = normal;
}

Hi Avi,
first of all many thanks to you!
Why did I start this thread here? Well, first of all, the problem described in this second posting is a little bit different, at least its context. So I chose another "subforum" than in the first posting. Additionally, as you see, there are different readers in the forums. I'm not sure whether I would have got this hint in Database/JVM, too.
But now to the main subject:
Your idea helped me indeed a little bit. I changed "SCOTT.Point" to "SCOTT.POINT" and "SCOTT.Triangle" to "SCOTT.TRIANGLE". Your proposition "SCOTT"."Point" didn't work since Ihave to return one single string.
The error montioned above in my first posting disappeared now, but I get the next error: java.lang.ClassCastException.
I tried all possible kinds of type cast:
public static int testfunction(oracle.sql.ARRAY trilist) throws SQLException
int n = trilist.length(); // this works !!!!
ARRAY obs = (ARRAY) trilist.getArray(); // this doesn't work !!!
Object[] obs = (Object[]) trilist.getArray(); // this doesn't work either
Triangle[] obs = (Triangle[]) trilist.getArray(); // this doesn't work either
return n;
Using "java.sql.Array" as input type and the method "java.sql.Array.getArray" leads to the same problems.
In many books expressions like in the code above are used for given resultSets. There, it works! :-(
Any ideas what could still be wrong?

Similar Messages

  • 1)unexpected Exception:page fault accessing tag table 2)java.rmi.MarshalException:Unexpected Exception page fault accessing page table

    i am trying to call WCF service by using Jsr 172 method
    but i got the two error
    1)unexpected Exceptionage fault accessing tag table
    2)java.rmi.MarshalException:Unexpected Exception page fault accessing page table
    does anybody knows about how to solve this error.
    Plz help me
    thanks in advance!!!!!!!!!!!
      My Code is:-----
    package com.rim.sample.webservicedemo;
    import java.rmi.RemoteException;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.MainScreen;
    public class webservice extends UiApplication
        public webservice()
            pushScreen(new myscreen());
        public static void main(String[] args)
            webservice t=new webservice();
            t.enterEventDispatcher();
    final class myscreen extends MainScreen implements FieldChangeListener
        //taking this program from :-http://blog.bayestech.com/?p=78
         public myscreen()
             setTitle("HI");
             ButtonField g=new ButtonField("OK",ButtonField.CONSUME_CLICK);
             g.setChangeListener(this);
             add(g);
        public void fieldChanged(Field field, int context)
            try
                testServiceCall();
            catch (RemoteException e)
                Dialog.alert(e.getMessage());
                Dialog.alert(e.toString());
         public void testServiceCall() throws RemoteException
                TestService_Stub service = new TestService_Stub();
                //String  message = service.helloWorld();
               // Dialog.alert(message);
              // String  message2=service.echoName("ankush,nilesh,chetan,ravi");
                //Dialog.alert(message+"  second message  "+message2);
                // Object addition_output=service.addition(7,2);
                 //Dialog.alert("your addition is" +  String.valueOf(addition_output));
                 String  login_message = service.logOn_method("abcdefg","aaaaa");
                 Dialog.alert("login successfully");
                 Dialog.alert(login_message);
    //////////////TestService_Stub class file///////////////////////
    package com.rim.sample.webservicedemo;
    import java.rmi.RemoteException;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.namespace.QName;
    import javax.microedition.xml.rpc.Operation;
    import javax.microedition.xml.rpc.Type;
    import javax.microedition.xml.rpc.ComplexType;
    import javax.microedition.xml.rpc.Element;
    import net.rim.device.api.ui.component.Dialog;
    public class TestService_Stub implements TestService,javax.xml.rpc.Stub
        ///calling web services by using jsr-172 method
        //website link :- http://blog.bayestech.com/?p=78
        private String[] _propertyNames;
        private Object[] _propertyValues;
      //  private Object[] _propertyValues1;
        public TestService_Stub()
            _propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
           // _propertyValues = new Object[] { "http://test.bayestech.com/Services/TestService.asmx" };
          // _propertyValues = new Object[] { "http://soft21/testWCF/Service.svc" };
            _propertyValues = new Object[] { "< url name >" };
     protected void _prepOperation(Operation op)
            for (int i = 0; i < _propertyNames.length; ++i)
                op.setProperty(_propertyNames[i], _propertyValues[i].toString());
     public String logOn_method(String usr_name,String password_name ) throws java.rmi.RemoteException
          Object inputObject[] = new Object[]
                  usr_name,
                  password_name
          Operation op = Operation.newInstance( _qname_operation_logOn, _type_logOn, _type_logOnResponse );
          _prepOperation( op );
          op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "<soap action name >" );
          Object resultObj;
          try
              resultObj = op.invoke( inputObject );
              Dialog.alert((String)resultObj);
          catch( JAXRPCException e )
              Throwable cause = e.getLinkedCause();
              if( cause instanceof java.rmi.RemoteException )
                  throw (java.rmi.RemoteException) cause;
              Dialog.alert(e.getMessage());
              throw e;
          return (String )((Object[])resultObj)[0];
     protected static final QName _qname_operation_logOn = new QName( "<soap action name>", "logOn" );
        protected static final QName _qname_logOnResponse = new QName( "<soap action name>", "logOnResponse" );
        protected static final QName _qname_logOn = new QName( "<soap action name>", "logOn" );
        protected static final Element _type_logOn;
        protected static final Element _type_logOnResponse;
        static
     _type_logOn = new Element( _qname_logOn, _complexType( new Element[] {
                 new Element( new QName( "<soap action name>", "usr_name" ), Type.STRING, 0, 1, false ),
                 new Element( new QName( "<soap action name>", "password_name" ), Type.STRING, 0, 1, false )}), 1, 1, false );
            _type_logOnResponse = new Element( _qname_logOnResponse, _complexType( new Element[] {
                  new Element( new QName( "<soap action name>", "logResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
        private static ComplexType _complexType( Element[] elements )
            ComplexType result = new ComplexType();
            result.elements = elements;
            return result;
        public void _setProperty(String name, Object value) {
            // TODO Auto-generated method stub
        public Object _getProperty(String name) {
            // TODO Auto-generated method stub
            return null;
        public String echoName(String name) throws RemoteException {
            // TODO Auto-generated method stub
            return null;
        public String helloWorld() throws RemoteException {
            // TODO Auto-generated method stub
            return null;
    i am trying to call WCF service by using Jsr 172 method
    but i got the two error
    1)unexpected Exceptionage fault accessing tag table
    2)java.rmi.MarshalException:Unexpected Exception page fault accessing page table
    does anybody knows about how to solve this error.
    Plz help me
    thanks in advance!!!!!!!!!!!
      My Code is:-----
    package com.rim.sample.webservicedemo;
    import java.rmi.RemoteException;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.MainScreen;
    public class webservice extends UiApplication
        public webservice()
            pushScreen(new myscreen());
        public static void main(String[] args)
            webservice t=new webservice();
            t.enterEventDispatcher();
    final class myscreen extends MainScreen implements FieldChangeListener
        //taking this program from :-http://blog.bayestech.com/?p=78
         public myscreen()
             setTitle("HI");
             ButtonField g=new ButtonField("OK",ButtonField.CONSUME_CLICK);
             g.setChangeListener(this);
             add(g);
        public void fieldChanged(Field field, int context)
            try
                testServiceCall();
            catch (RemoteException e)
                Dialog.alert(e.getMessage());
                Dialog.alert(e.toString());
         public void testServiceCall() throws RemoteException
                TestService_Stub service = new TestService_Stub();
                //String  message = service.helloWorld();
               // Dialog.alert(message);
              // String  message2=service.echoName("ankush,nilesh,chetan,ravi");
                //Dialog.alert(message+"  second message  "+message2);
                // Object addition_output=service.addition(7,2);
                 //Dialog.alert("your addition is" +  String.valueOf(addition_output));
                 String  login_message = service.logOn_method("abcdefg","aaaaa");
                 Dialog.alert("login successfully");
                 Dialog.alert(login_message);
    //////////////TestService_Stub class file///////////////////////
    package com.rim.sample.webservicedemo;
    import java.rmi.RemoteException;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.namespace.QName;
    import javax.microedition.xml.rpc.Operation;
    import javax.microedition.xml.rpc.Type;
    import javax.microedition.xml.rpc.ComplexType;
    import javax.microedition.xml.rpc.Element;
    import net.rim.device.api.ui.component.Dialog;
    public class TestService_Stub implements TestService,javax.xml.rpc.Stub
        ///calling web services by using jsr-172 method
        //website link :- http://blog.bayestech.com/?p=78
        private String[] _propertyNames;
        private Object[] _propertyValues;
      //  private Object[] _propertyValues1;
        public TestService_Stub()
            _propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
           // _propertyValues = new Object[] { "http://test.bayestech.com/Services/TestService.asmx" };
          // _propertyValues = new Object[] { "http://soft21/testWCF/Service.svc" };
            _propertyValues = new Object[] { "< url name >" };
     protected void _prepOperation(Operation op)
            for (int i = 0; i < _propertyNames.length; ++i)
                op.setProperty(_propertyNames[i], _propertyValues[i].toString());
     public String logOn_method(String usr_name,String password_name ) throws java.rmi.RemoteException
          Object inputObject[] = new Object[]
                  usr_name,
                  password_name
          Operation op = Operation.newInstance( _qname_operation_logOn, _type_logOn, _type_logOnResponse );
          _prepOperation( op );
          op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "<soap action name >" );
          Object resultObj;
          try
              resultObj = op.invoke( inputObject );
              Dialog.alert((String)resultObj);
          catch( JAXRPCException e )
              Throwable cause = e.getLinkedCause();
              if( cause instanceof java.rmi.RemoteException )
                  throw (java.rmi.RemoteException) cause;
              Dialog.alert(e.getMessage());
              throw e;
          return (String )((Object[])resultObj)[0];
     protected static final QName _qname_operation_logOn = new QName( "<soap action name>", "logOn" );
        protected static final QName _qname_logOnResponse = new QName( "<soap action name>", "logOnResponse" );
        protected static final QName _qname_logOn = new QName( "<soap action name>", "logOn" );
        protected static final Element _type_logOn;
        protected static final Element _type_logOnResponse;
        static
     _type_logOn = new Element( _qname_logOn, _complexType( new Element[] {
                 new Element( new QName( "<soap action name>", "usr_name" ), Type.STRING, 0, 1, false ),
                 new Element( new QName( "<soap action name>", "password_name" ), Type.STRING, 0, 1, false )}), 1, 1, false );
            _type_logOnResponse = new Element( _qname_logOnResponse, _complexType( new Element[] {
                  new Element( new QName( "<soap action name>", "logResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
        private static ComplexType _complexType( Element[] elements )
            ComplexType result = new ComplexType();
            result.elements = elements;
            return result;
        public void _setProperty(String name, Object value) {
            // TODO Auto-generated method stub
        public Object _getProperty(String name) {
            // TODO Auto-generated method stub
            return null;
        public String echoName(String name) throws RemoteException {
            // TODO Auto-generated method stub
            return null;
        public String helloWorld() throws RemoteException {
            // TODO Auto-generated method stub
            return null;

    Vishnu,
    I'm working on Ludwig's testcase.
    Ludwig's testcase is based on read-only View Objects.
    Is it also the case in your application ?
    I was unable to reproduce with VOs based on EOs.
    With read-only VOs, you can avoid the ArrayIndexOutOfBoundsException by setting the "Key Attribute" property for the PK of the Master VO.
    See the ADF Developer's Guide, topic "7.9.3 What You May Need to Know About Enabling View Object Key Management for Read-Only View Objects"
    URL: http://download-uk.oracle.com/docs/html/B25947_01/bcvoeo009.htm#BABJEEFA
    Regards,
    Didier.

  • Access SAP Tables from Java Program

    Hi All,
    We have a requirement to integrate attendance portal(which is done in java) with SAP.
    Our problem is how to access SAP tables from a Java program?
    Database is Sybase.
    Please suggest us a good solution.
    Thanks in advance...

    Did you go through Sap Help?
    Calling BAPIs from Java - BAPI User Guide CA-BFA) - SAP Library
    Regards,
    Philip.

  • 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.

  • Help on accessing tables in Java available in SAP system

    Hi All
    A day before I had posted a question regarding the accessing of tables available in SAP R/3 system in my Java code.
    I got the following code as reply. This code is working fine.
    But in the below example, the QUERY_TABLE IS BSAUTHORS.
    In my case, the QUERY_TABLE is VBKD(Sales Document Table).
    When I replace the table name with VBKD in place of BSAUTHORS, I am getting the following error:
    ERROR BEGIN----
    com.sap.mw.jco.JCO$AbapException: (126) DATA_BUFFER_EXCEEDED: Selected fields do not fit into structure DATA
    at com.sap.mw.jco.JCO$Function.getException(JCO.java:17978)
    at com.sap.mw.jco.JCO$Client.execute(JCO.java:3143)
    at com.insync.JCO.UpdateSalesOrder.main(UpdateSalesOrder.java:34)
    ERROR END----
    Can anyone please give me a solution for this?
    Thanks in Advace,
    Vijay.
    **********************Code**********************
    import com.sap.mw.jco.*;
    public class JcoTest {
    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");
    //listParams.setValue("VBKD", "QUERY_TABLE"); // ERROR
    theConnection.execute(function);
    JCO.Table tableList = function.getTableParameterList().getTable("DATA");
    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();

    Hello,
    VBKD is rearly a large table. I suggest to limit the number by filling the FIELDS Table. Also there can be many entries in VBKD and so you should limit the lines by a Where statement in OPTIONS.
    I think a better way are the BAPIs:
    - BAPI_SALESORDER_GETLIST
    - BAPISDORDER_GETDETAILEDLIST
    to get the details of an Salesorder.
    Regards
    Gregor

  • 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

  • How to access XI_AF_MSG table in Composite Application Framework Java Code

    Hi Experts,
    I've no knowledge about PI. In one of my projects, I need access the XI_AF_MSG table of PI through java code in a composite application.
    How do I access this table? I've searched this forum for this query but the replies say that any SQL editor can be used to access XI_AF_MSG table. But my question is; How do I get the login details of the database? In the first place, how do I access the underlying database layer of PI? Is there any JAR file which can be used to make the connection?
    It would be of great help if any expert on this can give me a detailed reply.
    Thanks a lot in advance.
    Best Regards,
    Nitin

    Hi Nitin,
    The AFW runs on the J2EE Engine, so this table is in the Java Schema of the database and thus not visible in the ABAP stack. I guess you can use any tool your database provider offers for looking at table contents (e.g. SQLPlus).
    Regarding how to access the table please contact you basis administrator they will have access to the tables as they have j2ee_admin login ids and pwds.
    Regards
    joel

  • Can we access PI tables from WebDynpro Java via PI 7.1?

    Hi Experts
    Is it possible to fetch PI Tables (to display monitoring and alerts as dashboard on portal) from Java Stack. I got some javadocs API SAP Netweaver for PI 7.1 but i don't know how far it can help me in solving my purpose of fetching and displaying the PI monitoring data on Portal.
    https://www.sdn.sap.com/irj/sdn/javadocs
    Please advise if J2EE access to PI Tables is possible or RFC is the suggested solution to fetch PI Monitoring data.
    Thanks
    Neha

    Hi Neha,
    You can access PI tables from Webdynpro Java application using RFC or Webservices. Create RFC or Webservices which will fetch data from the PI tables.Create the required JCO's and the Webdynpro java application which uses the Adaptive RFC model or Adaptive Webservice Model to connect to the ECC system.
    I found a document that speaks about fetching data from SXMB_MONI Standard Table https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050ff4f-84c3-2b10-3d99-8f9c44f57a17
    Hope this is useful.
    Regards,
    Seema Rane.

  • Linking Java to Access Database tables

    Hello,
    I need use JCreator to link Java to Access Database tables.
    Could any one tell me what kind of drivers I need use?
    Also, where could I find the examples of linking Java to Access Database tables?
    Thank you,
    Daniel

    Thanks.
    I have read the tutorial and downloaded the sample code from the web http://java.sun.com/docs/books/tutorial/jdbc/
    In the CreateCoffee.java programming, I made the following changes:
         //     String url = "jdbc:mySubprotocol:myDataSource";
              String url = "jdbc:odbc:DB1";
    DB1 is an Access Database file located in the same folder as CreateCoffee.java.
    //Class.forName("myDriver.ClassName");
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Every time when I run the CreateCoffee.java programming, it shows the following running error:
    SQLException:[Microsoft][ODBC Driver Manager]
    Data source name not found and no default driver specified.
    Could any one have any suggestions for solving the above problem?
    Thank you,
    Daniel

  • Writing a java program to access SAP tables using SAP JCO

    Hi all,
           I have a requirement where I need to access the VBAK table and get some values out of it based on a query on some of it fields. I would like to know how this can be done via a Java program by utilising the SAP JCo library. Has anyone done this before? A sample program would be very helpful.
    Thanks in advance!

    Hi SAM,
    Welcome to SDN!!!!!!
    Chk this help doc.
    http://help.sap.com/saphelp_nw04/helpdata/en/35/42e13d82fcfb34e10000000a114084/frameset.htm
    Also chk these thread.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8798be90-0201-0010-d093-85f728778d37
    Re: How to access SAP database tables with Java (Jco)
    Regards.
    Maha

  • Accessing dictionary tables from dynpro?

    Hi all
    As far as i know, there are 4 approches to access dictionary tables from webdynpro.
    -entity bean
    -sqlj
    -jdbc
    what are the advantages and disadvantages for all above?
    and which one to go for?

    Hi swathi
    See the persistence API--Adv and Disadvantages what ever you mentioned come under the persistence API
    Relational Persistence
    =================
    SQL-based coding: expressive!
    SQLJ: for static SQL, checked at design time,
    recommended
    JDBC: for dynamic SQL, can be combined with SQLJ
    =======================
    Object-relational Persistence
    ======================
    SQL-free! Portable!
    JDO: light-weight object persistence, Java-like dynamic
    query language
    EJB CMP: part of J2EE standard, relatively heavy-weight,SQL-like static query language
    Regards,
    Venkata Kalyan Karanam

  • How to programmatically connect to MS Access linked tables to oracle ?

    Hi,
    I have database in MS Access which has linked table in oracle database.
    But I am not able to connect to that linked table through java program .
    It gives me java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] ODBC--connection to 'servername' failed.
    Can anybody suggest me how to tackle this problem?

    This blog post should have most (if not all) of what you need:
    http://blogs.technet.com/b/heyscriptingguy/archive/2009/02/16/how-can-i-use-windows-powershell-to-create-an-office-access-database.aspx
    One thing to watch out for is the db provider for the connection string.  The "Jet Engine" has been superseded by
    ACE.

  • Access SAP BW from Java

    Hello,
    I need to build a Java web application that can collect and display data from various SAP BWs.
    Write operations are not required. What is the easiest way to do that?
    I found that SAP Open Hub Service lets you extract the data to a CSV file or a relational table.
    Assuming I go the way of creating a relational table, the following questions arise:
    - Where are those tables stored? Still within SAP BW or in an external relational DBMS (e.g. an Oracle database)?
    - How can I access those tables from within my Java code (just through a standard JDBC driver)?
    - Who initiates the population of those tables?
    - Can I trigger the extraction at a given time from within my java code?
    - If so, can I hand in filter critera, so that the table is populated only with data that matches my filter, or do I need to extract all data to the relational table and then filter at the next step?
    - Can I have a timer in the SAP BW that creates the table on a certain schedule (e.g. once per day)?
    What other (easier) options are there to achieve this task?
    Thanks,
    MARK
    Edited by: M. Arnold on Aug 17, 2010 9:50 AM

    Mark,
    What you can look at are :
    1. Use a JDBC connector to connect to the database directly - this has some obvious disadvantages because the data would have to be linked with the SID tables , text tables and Dimension tables for cubes which makes the process extremely cumbersome
    2. Use Openhub to extract to a relational table and access the same - possible , but you have two steps in between - openhub to update table and then access the table while maintaining data consistency - this might become a maintenance nightmare once you heavily use this concept
    3. Use web services - there are standard web services like query_view_data and rfc_read_tale which you can use - these web services are SOAP based and you should be able to use the same in your JAVA application
    4. Use the BI JAVA SDK to connect to the backend through an API supported by SAP - this would be easy to use - the SDk should be available on SCN or on the support marketplace and you shoiuld be able to use the same quite easily
    5. Use JCO and build the application using NWDS where you have native connectivity to SAP BW using JCO
    6. Use Web Dynpro JAVA to develop your application where you should be able to access the necessary APIs wherever required.
    Edited by: Arun Varadarajan on Aug 17, 2010 8:15 PM

  • Creating an auto incrementing field with CREATE TABLE from Java

    I'm using the "sun.jdbc.odbc.JdbcOdbcDriver" to get a connection towards an ODBC data source that's linked to a Access (.mdb) database.
    I've tried various combinations in my CREATE TABLE statement execution in order to create a table with an auto incrementing integer but neither of them work, not even the most obvious one:
    stmt.executeUpdate("CREATE TABLE mytable(uid integer AUTO_INCREMENT PRIMARY KEY);");
    I always get this runtime exception: *java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition*; and AUTO_INCREMENT is the problem. I've tried all variations like AUTO, INCREMENT, AUTOINCREMENT and such, but nothing works.
    I've looked everywhere but couldn't find an answer to this. Thanks for the help.

    You used MySQL syntax. I think you agree with me that Access isn't a MySQL database. Either use MySQL with a real JDBC driver (recommended) or use Access syntax.
    That said, creating databases and tables using Java is a bad idea. The database and table must be already there. With Java you just do the usual table operations like select, insert, update and delete. Nothing more is needed.

  • How to access af:table rows in JavaScript

    Hi,
    I have a requirement to access af:table rows in java script.I tried the same using following code.
    getRows returns the correct no of rows from the table, but table.getValue() returns null.
    var table = AdfPage.PAGE.findComponentByAbsoluteId('t1');
    if (table != null){
    alert(table.getRows());
    alert(table.getFirst());
    alert(table.getValue());
    Any pointers on how i can achieve this.

    We have a requirement where in,we have to check if the order number is already added to the cart(cart here is a table)
    and this validation needs to be done as soon as you enter 10 digits in the input field for order number.
    in short,order need to validated if its duplicate order against table at client side(sson as you enter 10 digits in order number)
    initially I was trying to implemet this with ServerSide listner as below
    Java script on page :
    function addDuplicate(evt) {
    var source = evt.getSource();
    AdfCustomEvent.queue(source, "MyCustomServerEvent",
    false);
    event.cancel();
    Bean method
    public void callAddDuplicateSeverEvt(ClientEvent clientEvent) {
    ADFContext.getCurrent().getPageFlowScope().put("dupOrderNumFlag", "N");
    System.out.println("in handle Add duplicate::"+ ADFContext.getCurrent().getPageFlowScope().get("dupOrderNumFlag"));
    input text on page
    ====
    <af:inputText label="" id="it1" value="#{pageFlowScope.dspOrderNum}"
    columns="14" autoComplete="off" styleClass="orderveritext"
    maximumLength="10" >
    <af:clientListener method="validateOrderNumChars" type="keyPress"/>
    <af:clientListener method="enableAddButton" type="keyUp"/>
    <af:clientListener method="addDuplicate" type=" keyPress "/>
    <af:serverListener type="MyCustomServerEvent"
    method="#{viewScope.HLKioskBean.callAddDuplicateSeverEvt}"/>
    </af:inputText>
    Problem with this solution is My application is KIOSK app(touch screen) on every key press in order num input field screen flickers,looks like its trying to do Full page rendering(though i do not have any PPR) in every call to serverListerner.
    Please advise.

Maybe you are looking for

  • How to get XML output from a stored procedure

    I have a very simple question: I would like to write a stored procedure (SP) that will return results in XML format (as a string). My tables in database are not of XML TYPE. But I need XML output. ie, SP will run like a typical SP but the only differ

  • Itunes won't launch while Ipod is connected

    iTunes will work for me when my iPod isn't connected but as soon as I connect my iPod iTunes freezes. I've tryed the 5 R's but they haven't worked. Is the problem my iPod or iTunes and how do I fix it?

  • Inspire P580 PSU seems dead

    Hello! I need some help. I've got an Inspire P580 Speaker set from a friend but it seems that the power supply is dead. I tested the kit with my P380's PSU justo to see if it was in fact from the PSU and the kit worked, but as would be expected, poor

  • DVD player doesn't play some DVDs

    I've had my macbookpro for several months now. I've been mostly satisfied, but the DVD player seems to be messed up. I have never had a problem with software or CDs, but every once in a while, the DVD player will not play movies. Most of the time, th

  • Intermittent problems importing images into Captivate 5 from PowerPoint 2010 slides

    Occasionally, when I import slides from a PowerPoint 2010 pptx file, certain of the images don't move over into captivate. Most (if not all) of my images have been saved as .jpg files, so I don't believe that there would be problems with different fi