Java Api Imports

Hi all,
i try to connect to the MDM Server, but i have some problems with my imports.
I am importing:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import a2i.common.CatalogData;
import com.sap.mdm.util.RC;
import com.sapportals.connector.connection.IConnection;
import com.sapportals.connector.connection.IConnectionFactory;
import com.sapportals.connector.connection.IConnectionSpec;
import com.sapportals.connector.connection.INative;
and at this position i get an Error:
IConnectionSpec spec = factory.getConnectionSpec();
Error:
The type javax.resource.cci.ConnectionSpec cannot be resolved. It is indirectly referended from required .class files.
Eclipse shows me to reconfigure the Build Path, but i don t see any errors.
Thx for Help

Ok, i found the missing jar file.
connector.jar from J2EE Client (AS)

Similar Messages

  • Create User in OID using Java API

    I read the documentation, read javadoc for Java API for OID, but still am not clear "how can I create a user in OID using Java API for OID."
    It tells us how to create a java object User, but then how do we write this object to OID ?
    I searched every where, metalink, forums, google...and am still looking for answere...
    Thanks in Advance
    Cheers
    Puneet

    I did it using the Novell LDAP java api:
    import com.novell.ldap.*;
    public class LdapAdmin {
    public static final String ldap_base = "dc=your,dc=company,dc=com";
    public static final String ldap_user_base = "cn=Users," + ldap_base;
    public static final String ldap_portal_base = "cn=PORTAL_GROUPS,cn=Groups," + ldap_base;
    public static final String ldap_extended_base = "cn=Extended Properties,cn=OracleContext," + ldap_base;
    public static final String ldap_dbdomain_base = "cn=OracleDefaultDomain,cn=OracleDBSecurity,cn=Products,cn=OracleContext," + ldap_base;
    public static final String ldap_context_base = "cn=COMMON,cn=OracleDBAppContext," + ldap_dbdomain_base;
    private static final String default_ldap_host = "infrastructure.your.company.com";
    private static final int default_ldap_port = 4032;
    private static final String default_ldap_login = "cn=orcladmin," + ldap_user_base;
    private static final String default_ldap_pwd = "welcome1";
    private static final String default_user_pwd = "secret";
    private static final String[] personclass_values = { "top", "person", "organizationalPerson", "inetOrgPerson", "orcluser", "orcluserv2" };
    public static LDAPConnection getConnection (String host, int port, String user, String pwd) {
    LDAPConnection lc = new LDAPConnection();
    try {
    lc.connect(host,port);
    lc.bind(user,pwd);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in getConnection: "+lex.getResultCode()+"-"+lex.getLDAPErrorMessage());
         return lc;
    public static LDAPConnection getConnection (String host, int port) {
    LDAPConnection lc = new LDAPConnection();
    try {
    lc.connect(host,port);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in getConnection: "+lex.getResultCode()+"-"+lex.getLDAPErrorMessage());
         return lc;
    public static LDAPConnection getConnection (String user, String pwd) {
    LDAPConnection lc = new LDAPConnection();
    try {
    lc.connect(default_ldap_host,default_ldap_port);
    lc.bind(user,pwd);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in getConnection: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    lex.printStackTrace();
         return lc;
    public static LDAPConnection getConnection () {
    return getConnection(default_ldap_host,default_ldap_port);
    public static void bind (LDAPConnection conn, String user, String pwd) {
    try {
    conn.bind(user,pwd);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in bind: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    lex.printStackTrace();
    private static void bind (LDAPConnection conn) {
    bind(conn,default_ldap_login,default_user_pwd);
    public static void modifyAttribute (LDAPConnection conn, String dn, String attr, String val, int mod) {
    LDAPAttribute attribute = new LDAPAttribute(attr,val);
    LDAPModification[] modification = new LDAPModification[] { new LDAPModification(mod,attribute) };
    try {
    conn.modify(dn,modification);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in modifyAttribute: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    public static void modifyAttribute (LDAPConnection conn, String dn, String attr, String val) {
    modifyAttribute(conn,dn,attr,val,LDAPModification.REPLACE);
    public static void addAttribute (LDAPConnection conn, String dn, String attr, String val) {
    modifyAttribute(conn,dn,attr,val,LDAPModification.ADD);
    public static void deleteAttribute (LDAPConnection conn, String dn, String attr, String val) {
    modifyAttribute(conn,dn,attr,val,LDAPModification.DELETE);
    public static void deleteEntry (LDAPConnection conn, String dn) {
    try {
    conn.delete(dn);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in deleteEntry: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    public static boolean isValidDn(LDAPConnection conn, String dn) {
    try {
    LDAPSearchResults res = conn.search(dn);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in deleteEntry: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    return false;
    public static void createPerson (LDAPConnection conn, String net_id, String lname, String fname, String office, String email, String id, String fullname) {
         LDAPAttributeSet attributeSet = new LDAPAttributeSet();
    attributeSet.add(new LDAPAttribute("cn", net_id));
    attributeSet.add(new LDAPAttribute("sn", lname));
    attributeSet.add(new LDAPAttribute("objectclass", personclass_values));
    attributeSet.add(new LDAPAttribute("l", office));
    attributeSet.add(new LDAPAttribute("mail", email));
    attributeSet.add(new LDAPAttribute("employeeNumber", id));
    attributeSet.add(new LDAPAttribute("givenName", fname));
    attributeSet.add(new LDAPAttribute("uid", net_id));
    // attributeSet.add(new LDAPAttribute("fullName", fullname));
    attributeSet.add(new LDAPAttribute("orclpkcs12hint", default_user_pwd));
    attributeSet.add(new LDAPAttribute("orclpassword", VerifyPassword.getHash(net_id,default_user_pwd)));
    attributeSet.add(new LDAPAttribute("userpassword", default_user_pwd));
    attributeSet.add(new LDAPAttribute("orcldefaultprofilegroup", "cn=DEFAULT,"+ldap_portal_base));
    LDAPEntry entry = new LDAPEntry("cn="+net_id+","+ldap_user_base,attributeSet);
    try {
    conn.add(entry);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in createPerson: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    public static void updatePerson (LDAPConnection conn, String net_id, String lname, String fname, String office, String email, String id, String fullname) {
    LDAPModification[] mod = new LDAPModification[8];
    mod[0] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("cn", net_id));
    mod[1] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("sn", lname));
    mod[2] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("l", office));
    mod[3] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("mail", email));
    mod[4] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("employeeNumber", id));
    mod[5] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("givenname", fname));
    mod[6] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("fullName", fullname));
    mod[7] = new LDAPModification(LDAPModification.REPLACE,new LDAPAttribute("uid", net_id));
    try {
    conn.modify("cn="+net_id+","+ldap_user_base,mod);
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in updatePerson: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    public static void main (String[] args) {
    try {
    LDAPConnection conn = getConnection(default_ldap_login,default_ldap_pwd);
    // updatePerson(conn,"ID1","Somebody","Joe","CLE","[email protected]","1","Joe Somebody 2");
    // modifyAttribute(conn,"cn=ID1,"+ldap_user_base,"fullName","Joe Somebody",LDAPModification.REPLACE);
    // modifyAttribute(conn,"cn=ID1,"+ldap_user_base,"displayName","Joe Somebody");
    createPerson(conn,"ID1","Somebody","Joe","CLE","[email protected]","1","Joe Somebody");
    // deleteEntry(conn,"cn=ID1,"+ldap_user_base);
    conn.disconnect();
    } catch (LDAPException lex) {
    System.out.println("LDAP Error in main: ("+lex.getResultCode()+") - "+lex.getLDAPErrorMessage());
    }

  • Import metadata using owb java api

    Hi,
    We are working on a tool to atomize some OWB projects and therefore we chosen to use the OWB java api. Now we wanted to import oracle tables metadata into our new created project,
    the problem is that is not very clear how to do it. We tryed using classes like ActionPlanCmdExecuter or ImportActionPlanCmdExecuter but with no success.
    Is there anybody who did this before and can point me in the right direction?
    Regards and have a nice holiday,
    Cipi

    Hi
    There are a couple of options;
    1. You can just write the code as an OMB script, since the OMB runs in a JACL container you can intermix OMB and java.
    See the java:: commands which you can use to invoke java from within tcl;
    http://tcljava.sourceforge.net/docs/TclJava/contents.html
    2. There is an OMBEngine class that lets you execute OMB commands from within java that works like the following;
    import oracle.owb.scripting.OMBEngine;
    import tcl.lang.TclObject;
    import tcl.lang.TclList;
    * This is an example showing some basic use of <code>OMBEngine</code> class.
    * It executes several OMBPlus commands through <code>OMBEngine</code>. For
    * most commands it just display the result. For one OMBLIST command, it also
    * loops through the elements in the return list, and displays them one by one.
    public class OMBEngineExample1
    public static void main(String args[]) {
    try {
    OMBEngine engine = new OMBEngine();
    String rslt = engine.executeStr("OMBCONNECT IM_DESIGNER/xxxx@localhost:1521:ora112");
    System.out.println("OMBCONNECT result: " + rslt);
    rslt = engine.executeStr("OMBLIST PROJECTS");
    System.out.println("OMBLIST PROJECTS result: " + rslt);
    rslt = engine.executeStr("OMBCC 'MY_PROJECT'");
    System.out.println("OMBCC result: " + rslt);
    TclObject objRslt = engine.execute("OMBLIST ORACLE_MODULES");
    System.out.println("OMBLIST ORACLE_MODULES result as string: " + objRslt);
    // now get each object from the list and print it individually...
    System.out.println("OMBLIST ORACLE_MODULES result as list of TclObject:");
    for (int i = 0; i < TclList.getLength(engine.getInterp(),objRslt); i++) {
    TclObject to = TclList.index(engine.getInterp(), objRslt, i);
    System.out.println(" Object " + i + ": " + to);
    rslt = engine.executeStr("OMBDISCONNECT");
    System.out.println("OMBDISCONNECT result: " + rslt);
    System.exit(0);
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    Happy New Year to you too! Excuse my late reply!
    Cheers
    David

  • Importing the Java API into basic programs

    How do I import the API that comes with the JDK1.3 into my programs ? Is it a case of simply import java.api.*; ??
    Does the new 1.3 version of the compiler include a Javabook which can be imported into programs. I have a text book which has sample programs which import Javabook. When I come to compile them, the compiler reports that Javabook is not known. Is Javabook from an earler version of the java compiler ?

    It depends on what you want to do just as an example if you wanted to create a window app with a textfield you would need to import the necessary classes. Here is a sample of a JFrame with a text field:
    import javax.swing.*;
    import java.awt.*;
    public class Frame1 extends JFrame
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    JTextField jTextField1 = new JTextField();
    public Frame1()
    super();
    try
    jbInit();
    catch (Exception e)
    e.printStackTrace();
    private void jbInit() throws Exception
    this.getContentPane().setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    jTextField1.setText("jTextField1");
    this.getContentPane().add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(jTextField1, null);
    Note the import statements of java.awt.*; and javax.swing.*; this tells the compiler the to look for all the files needed to create this frame. The compiler already knows what it needs from the API, you just have to tell it where to look.
    In short JavaBook should either come with the book on CD ROM or you have to download it from the publisher. Also check and see what files you need to import and use the import statement to point to the file that it needs: for example
    import JavaBook.*;
    Hope this helps

  • Invoking a BPEL process  from java API (Urgent)

    Hi,
    I am using this java api to invoke a bpel process.
    package mypackage;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.dispatch.IDeliveryService;
    import com.oracle.bpel.client.ServerException;
    public class InvokeBpel1
    // Connect to domain “default” using password “bpel”
    // null IP address means local server
    public static void main(String args[])
    Locator locator=null;
    String xml =" <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope\">"
    +"<soap:Header/>"
    +" <soap:Body xmlns:ns1=\"http://xmlns.oracle.com/BPELMultiplePO\">"
    +"<ns1:BPELMultiplePOProcessRequest>"
    +" <ns1:input>4686</ns1:input>"
    +" </ns1:BPELMultiplePOProcessRequest>"
    +" </soap:Body>"
    +"</soap:Envelope>";
    try
    locator = new Locator("default","bpel","10.227.5.34");
    IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    NormalizedMessage nm = new NormalizedMessage( );
    nm.addPart("payload", xml );
    NormalizedMessage res =
    deliveryService.request("BPELMultiplePO(v1.1)", "process", nm);
    catch (Exception e)
    e.printStackTrace();
    But it is showing following errors.----
    java.lang.Exception: Failed to create "ejb/collaxa/system/DomainManagerBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DomainManagerBean not found
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
         at com.evermind.naming.FilterContext.lookup(FilterContext.java:138)
         at com.evermind.naming.SubFilterContext.lookup(SubFilterContext.java:55)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.oracle.bpel.client.util.BeanRegistry.lookupDomainManagerBean(BeanRegistry.java:218)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:83)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:47)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:87)
         at mypackage.InvokeBpel1.main(InvokeBpel1.java:26)
         at com.oracle.bpel.client.util.BeanRegistry.lookupDomainManagerBean(BeanRegistry.java:232)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:83)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:47)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:87)
         at mypackage.InvokeBpel1.main(InvokeBpel1.java:26)
    What should I do remove this problem?

    Your problem sounds like many RMI problems answered in this forum in the past, especially if the java client is not on the same container as the bpel engine.
    Usually solved with setting some environment properties like dedicated.rmicontext=true etc.
    Please search the forum history.

  • How do I create a user, in my context in OID using the Java API

    How do I create a user, with subschema, in my context in OID using the JAVA API
    I need to be able to create new users in my OID, I was doing it in our old iPlant Directory, but I don't seem to see the same methods in the Oracle LDAP API. I figured out how to get and modify the attributes of a user, but I can't seem to figure out how to add a new one.

    Try this code , modify it accordingly
    ------- cut here -------
    import oracle.ldap.util.*;
    import oracle.ldap.util.jndi.*;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    import java.io.*;
    import java.util.*;
    public class NewUser
    final static String ldapServerName = "yourLdapServer";
    final static String ldapServerPort = "4032";
    final static String rootdn = "cn=orcladmin";
    final static String rootpass = "welcome1";
    public static void main(String argv[]) throws NamingException
    // Create the connection to the ldap server
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx(ldapServerName,
    ldapServerPort,
    rootdn,
    rootpass);
    // Create the subscriber object using the default subscriber
    Subscriber mysub = null;
    String [] mystr = null;
    try {
    RootOracleContext roc = new RootOracleContext(ctx);
    mysub = roc.getSubscriber(ctx, Util.IDTYPE_DN, "o=dec", mystr);
    catch (UtilException e) {
    e.printStackTrace();
    // Create ModPropertySet with user information
    ModPropertySet mps = new ModPropertySet();
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"cn", "Steve.Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"sn", "Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"uid", "SHarvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"givenname", "Steve");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"mail", "[email protected]");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"userpassword", "welcome1");
    // Create the user
    User newUser = null;
    try {
    newUser = mysub.createUser(ctx, mps, true);
    System.out.println("New User DN: " + newUser.getDN(ctx));
    catch (UtilException e) {
    e.printStacktrace();
    ------- end cut --------
    Enjoy.
    Suhail

  • MDM Java API (Creation of table)

    Hi,
    can anyone help me for  creation of tables in repository using MDM java API .
    Can u Provide sample code for this.
    Edited by: Srikanth Josyula on Jun 26, 2008 8:52 AM

    Hi Srikanth,
    Check with this code.It may be useful.
    createflattable.java
    Created on June 25, 2008, 5:08 PM
    To change this template, choose Tools | Options and locate the template under
    the Source Creation and Management node. Right-click the template and choose
    Open. You can then make changes to the template in the Source Editor.
    package tabletype;
    import com.sap.mdm.commands.AuthenticateRepositorySessionCommand;
    import com.sap.mdm.commands.CommandException;
    import com.sap.mdm.commands.CreateRepositorySessionCommand;
    import com.sap.mdm.commands.GetRepositoryRegionListCommand;
    import com.sap.mdm.data.MultilingualString;
    import com.sap.mdm.data.RegionProperties;
    import com.sap.mdm.data.RegionalString;
    import com.sap.mdm.net.ConnectionException;
    import com.sap.mdm.net.ConnectionPool;
    import com.sap.mdm.net.ConnectionPoolFactory;
    import com.sap.mdm.schema.TableProperties;
    import com.sap.mdm.schema.commands.CreateTableCommand;
    import com.sap.mdm.schema.commands.GetFieldListCommand;
    import com.sap.mdm.schema.commands.GetTableListCommand;
    import com.sap.*;
    import com.sap.mdm.server.DBMSType;
    import com.sap.mdm.server.RepositoryIdentifier;
    import java.util.Locale;
    public class createflattable {
        /** Creates a new instance of createflattable */
        public createflattable() {
            private static MultilingualString createMultilingualString(RegionProperties[] regionPropertiesList, String baseString)
            MultilingualString mlString = new MultilingualString();
            for (int i = 0; i < regionPropertiesList.length; i++)
                Locale locale = regionPropertiesList<i>.getLocale();
                //Locale locale = regionPropertiesList<i>.getLocale();
                String regionCode = regionPropertiesList<i>.getRegionCode();
                String string = baseString + "_" + locale.getLanguage() + "_" + locale.getCountry();
                RegionalString regionalstring = new RegionalString(string, regionCode);
                mlString.set(regionalstring);
            return mlString;
        private static TableProperties createFlatTable(RegionProperties[] regionPropertiesList)
            //MultilingualString tableName = createMultilingualString(regionPropertiesList, "NewTable" + System.currentTimeMillis());
    MultilingualString tableName = createMultilingualString(regionPropertiesList, "first"+System.currentTimeMillis());
    System.out.println("table is" +tableName);
            TableProperties table = new TableProperties(TableProperties.FLAT);       
            table.setName(tableName);
            table.setCode("NewCode" + System.currentTimeMillis());
            table.setKeyMappable(true);
            table.setDescription("");
            return table;
          public static void main(String[] args) {
                // System Name
         String tag = "";
        ConnectionPool connections = null;
    try {
        connections = ConnectionPoolFactory.getInstance(tag);
    catch (ConnectionException e)
    e.printStackTrace();
    return;
    //////////////// specify the repository to use
    //RepositoryName
    String repositoryName = "";
    //DataBase Name
    String dbmsName = "";
    RepositoryIdentifier  reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);
    /////// create a repository session
    CreateRepositorySessionCommand sessionCommand = new CreateRepositorySessionCommand(connections);
    sessionCommand.setRepositoryIdentifier(reposId);
    try {
    sessionCommand.execute();
    catch (CommandException e) {
    e.printStackTrace();
    return;
    System.out.println("Currently connected to "+reposId);
    String sessionId = sessionCommand.getRepositorySession();
    /////////// authenticate the repository session
    String userName = "";
    String userPassword = "";
    AuthenticateRepositorySessionCommand authCommand = new AuthenticateRepositorySessionCommand(connections);
    authCommand.setSession(sessionId);
    authCommand.setUserName(userName);
    authCommand.setUserPassword(userPassword);
    try {
    authCommand.execute();
    catch (CommandException e) {
    e.printStackTrace();
    return;
    //////////////////// retrieve the list of tables
    GetTableListCommand tableListCommand = new GetTableListCommand(connections);
    tableListCommand.setSession(sessionId);
    try {
    tableListCommand.execute();
    catch (CommandException e) {
    e.printStackTrace();
    return;
    // get change stamp
      // this is required when we make any kind of changes to the repository
         int changeStamp = tableListCommand.getChangeStamp();
         //////get repository regionlist
    //A command for retrieving the list of regions supported by the repository.
          // retrieve the available regions (languages) for the repository
          // we need this to set up the table name for each region
      GetRepositoryRegionListCommand gm =  new GetRepositoryRegionListCommand(connections);
       gm.setRepositoryIdentifier(reposId);
            try {
               gm.execute();
            catch (CommandException e) {
                e.printStackTrace();
                return;
       //   RegionProperties[] rs = gm.getRegions();
    RegionProperties[] regionPropertiesList = gm.getRegions();
          TableProperties newtable = createFlatTable(regionPropertiesList);
          CreateTableCommand c = new CreateTableCommand (connections);
            c.setSession(sessionId);
          c.setTable(newtable);
       c.setInChangeStamp(changeStamp);
            try {
                 c.execute();
                System.out.println("sdf");
            catch (CommandException e) {
                e.printStackTrace();
                return;

  • Java API for running entire ".sql" files on a remote DB ( mySQL or Oracle)?

    Hi,
    Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?
    It's enough if the API works with MySQL and/or Oracle.
    Just to demonstrate what i'm looking for:
    Suppose you've created sql file "c:/test.sql" with several script lines:
    -- test.sql:
    insert into TABLE1 values(3,3);
    insert into TABLE1 values(5,5);
    create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific
    Then the java API should look something like:
    // Dummy java code:
    String driver="com.mysql.jdbc.Driver";
    String url= "jdbc:mysql://localhost:3306/myDb";
    SomeAPI.executeScriptFile( "c:/test.sql", driver, url);
    Thanks.

    No such a API, but it's easy to parse all sqls in a file, then run those command:
    For instance:
    import java.sql.*;
    import java.util.Properties;
    /* A demo show how to load some sql statements. */
    public class testSQL {
    private final static Object[] getSQLStatements(java.util.Vector v) {
    Object[] statements = new Object[v.size()];
    Object temp;
    for (int i = 0; i < v.size(); i++) {
    temp = v.elementAt(i);
    if (temp instanceof java.util.Vector)
    statements[i] = getSQLStatements( (java.util.Vector) temp);
    else
    statements[i] = temp;
    return statements;
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    case '!': //Use it to get a large number of simple update statements
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    String part1 = temp.substring(1);
    String part2 = br.readLine();
    for (int i = -2890; i < 1388; i += 39)
    batchs.addElement(part1 + i + part2);
    for (int i = 1890; i < 2388; i += 53) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 4320; i > 4268; i--) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 9389; i > 7388; i -= 83)
    batchs.addElement(part1 + i + part2);
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    public static void main(String argv[]) {
    try {
    String url;
    Object[] statements;
    switch (argv.length) {
    case 0: //Use it for the simplest test
    case 1:
    url = "jdbc:dbf:/.";
    if (argv.length == 0) {
    statements = new String[1];
    statements[0] = "select * from test";
    else
    statements = argv;
    break;
    case 2:
    url = argv[0];
    statements = getSQLStatements(argv[1]);
    break;
    default:
    throw new Exception(
    "Syntax Error: java testSQL url sqlfile");
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    //Please see Connecting to the Database section of Chapter 2. Installation in Development Document
    Properties properties = new Properties();
    Connection con = DriverManager.getConnection(url, properties);
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    //Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    // stmt.setMaxRows(0);
    stmt.setFetchSize(10);
    final boolean serializeFlag = false;//A test switch to serialize/deserialize the resultSet
    ResultSet rs;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    if (serializeFlag) {
    // serialize the resultSet
    try {
    java.io.FileOutputStream fileOutputStream = new
    java.io.FileOutputStream("testrs.tmp");
    java.io.ObjectOutputStream
    objectOutputStream = new java.io.
    ObjectOutputStream(fileOutputStream);
    objectOutputStream.writeObject(rs);
    objectOutputStream.flush();
    objectOutputStream.close();
    fileOutputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    // deserialize the resultSet
    try {
    java.io.FileInputStream fileInputStream = new
    java.io.FileInputStream("testrs.tmp");
    java.io.ObjectInputStream objectInputStream = new
    java.io.ObjectInputStream(
    fileInputStream);
    rs = (ResultSet) objectInputStream.
    readObject();
    objectInputStream.close();
    fileInputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    // System.out.println(resultSetMetaData.getColumnName(j));
    /* System.out.println(resultSetMetaData.getColumnType(j));
    System.out.println(resultSetMetaData.getColumnDisplaySize(j));
    System.out.println(resultSetMetaData.getPrecision(j));
    System.out.println(resultSetMetaData.getScale(j));
    System.out.println(resultSetMetaData.
    getColumnLabel(j)
    + " " +
    resultSetMetaData.getColumnTypeName(j));
    Object colval;
    rs.beforeFirst();
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the resultSet release its open tables at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();
    stmt.close();
    con.close();
    catch (SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" + sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();

  • Need JAVA API to list down all the Proxy Services in OSB Console 11g

    Hi,
    I need a java API to List down all the Proxy Services present in OSB Console for SOA 11g (11.1.1.5). I am in a situation where I cant use python script for the same.
    any help will be much appreciated.
    Thanks in Advance,
    Ravi
    Edited by: 899443 on Oct 1, 2012 4:13 AM

    AFAIK it is proprietary.
    What I do in a similar situation is to form XML for the services, package them into JAR the same way as an import JAR is packaged (creating ExportInfo resource, ...) and deploy with standard WSLT script. Works for simplest services only (direct proxies mostly) but I can also form security, alerts, throttling etc etc etc -- all in one shot.
    Out of sheer interest, may I ask you a question? Why do you need to create OSB services from Java?
    Vlad
    http://vladimirdyuzhev.com

  • XI interface with third party using Java API

    Hi All,
    We have the following requirement:
    XI needs to interface with an external third party system which has JAVA API capabilities and the corresponding JAR files available to us.
    I have seen a few threads where it was mentioned that we could call the Java methods directly in User Defined functions:
    Process Integration (PI) & SOA Middleware
    My question: Is this approach feasible in our scenario? Also I guess we do not need to configure any adapter for this Java Method call within the UDF.
    Your help will be greatly appreciated and rewarded.
    Regards,
    Jai.

    Thanks Stefan.
    Our requirement has slightly changed. We have installed a thirdparty application on XI Server (within our network , inside filrewall). The application with Java API Jar file. All it does is a Lookup and retruns a value.
    We are planning to import the Jar file into imported Archives and call the method within a UDF.
    Is this feasible? I am going to give it a try.
    Your expert comments are greatly appreciated.
    Thanks
    Jai

  • Java API for working with digital signature.

    Hi,
         I have to check whether a pdf form is modified since it is digitally signed, using a java program.
         Are there any java APIs(provided by SAP) available for that?
         Can I use IWDPDFDocument API in java program? I tried it but I am getting 'classnotfoundexception'.
    Thanks,
    Prabhakar.

    may i know what service pack of SAP NetWeaver  Developer Studio version are you using?
    as the "IWDPDFDocument" is only available on SAP NetWeaver 2004S SPS 10 and above
    and you just need to import either this two class
    com.sap.tc.webdynpro.clientserver.adobe.api
    com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api 
    hope this information could help you
    Regards
    Jia Jun

  • Using the Data Engine Java API

    I try to use the Data Engine Java API to generate an XML document from database data.
    So as mentioned in the documentation Business Intelligence Publisher User's Guide Release 10.1.3.2 (page 4-26 to 4-27)
    a) I created a java class (using Jdev Version 11.1.1.0.0)
    package oracle.apps.XMLPublisher.client;
    import com.sun.java.util.collections.Hashtable;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import oracle.apps.xdo.XDOException;
    import oracle.apps.xdo.dataengine.DataProcessor;
    public class XMLFileGenerator {
    public XMLFileGenerator() {
    public static void dataEngine() throws ClassNotFoundException, Exception {
    XMLFileGenerator xMLFileGenerator = new XMLFileGenerator();
    try {
    //Initialization instantiate the DataProcessor class//
    DataProcessor dataProcessor;
    dataProcessor = new DataProcessor();
    //Set Data Template to be executed
    dataProcessor.setDataTemplate("PERFRBS.xml");
    Hashtable parameters;
    parameters = new Hashtable();
    parameters.put("P_LEGAL_ENTITY_ID", "3259");
    parameters.put("P_TRU_ID", "3262");
    parameters.put("P_YEAR", "2009");
    dataProcessor.setParameters(parameters);
    // Now set the jdbc connection to the database that you
    // wish to execute the template against.
    // This sample assumes you have already created
    // the connection object 'jdbcConnection'
    Class.forName("oracle.jdbc.OracleDriver");
    String url =
    "jdbc:oracle:thin:@ap6005sdb.us.oracle.com:1526:hremeadv";
    Connection jdbcConnection;
    jdbcConnection= DriverManager.getConnection(url, "apps", "*****");
    dataProcessor.setConnection(jdbcConnection);
    System.out.println("Here1");
    // Specify the output directory and file for the data file
    dataProcessor.setOutput("BilanSocial.xml");
    System.out.println("Here2");
    dataProcessor.processData();
    System.out.println("Here3");
    } catch (SQLException e) {
    System.out.println("SQLException " + e.getMessage());
    } catch (XDOException e) {
    System.out.println("XDOException" + e.getMessage());
    public static void main(String[] argv) throws ClassNotFoundException,
    Exception {
    XMLFileGenerator xmlPublisher = new XMLFileGenerator();
    XMLFileGenerator.dataEngine();
    b) to generate my xml file based on the following data template
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <dataTemplate name="PERFRBS" defaultPackage="" version="1.0">
    <parameters>
    <parameter name="P_LEGAL_ENTITY_ID" dataType = "number"></parameter>
    <parameter name="P_TRU_ID" dataType = "number"></parameter>
    <parameter name="P_YEAR" dataType = "number"></parameter>
    </parameters>
    <lexicals>
    </lexicals>
    <dataQuery>
    <sqlStatement name="Q_INDICATORS">
    <![CDATA[ SELECT pai.action_information3   YEAR,
                    pai.action_information17  INDICATOR_VALUE
              FROM   pay_action_information pai 
             WHERE  pai.action_information_category     = 'HR_FR_BS'
                AND    pai.action_context_type             = 'PA'
                AND    pai.action_information1             = :P_LEGAL_ENTITY_ID
                AND    pai.action_information2             = :P_TRU_ID
                AND    pai.action_information3            = :P_YEAR       
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_YEARS" dataType="varchar2" source="Q_INDICATORS">
    <element name="YEAR" dataType="varchar2" value="YEAR"/>
    <element name="INDICATOR_VALUE" dataType="number" value="INDICATOR_VALUE"/>
    </group>
    </dataStructure>
    </dataTemplate>
    ---> But when I run it , it fails when calling the data processor with the following error
    D:\Jdeveloper11g\jdk\bin\javaw.exe -client -classpath "D:\Jdeveloper11g\jdevhome\XMLPublisher\src\Client\classes;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\versioninfo.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\xdocore.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\collections.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\xmlparserv2-904.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\i18nAPI_v3.jar;D:\Jdeveloper11g\jdbc\lib\ojdbc14dms.jar;D:\Jdeveloper11g\jlib\orai18n.jar;D:\Jdeveloper11g\diagnostics\lib\ojdl.jar;D:\Jdeveloper11g\jlib\dms.jar" -Dhttp.proxyHost=emeacache.uk.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts= -Dhttps.proxyHost=emeacache.uk.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts= oracle.apps.XMLPublisher.client.XMLFileGenerator
    Here1
    Here2
    Exception in thread "main" java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleStatement from class oracle.apps.xdo.dataengine.DBConnection
         at oracle.apps.xdo.dataengine.DBConnection.setRowPrefetchSize(DBConnection.java:42)
         at oracle.apps.xdo.dataengine.XMLPGEN.setRowPrefetchSize(XMLPGEN.java:1224)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:420)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:281)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:251)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:192)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:222)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:334)
         at oracle.apps.XMLPublisher.client.XMLFileGenerator.dataEngine(XMLFileGenerator.java:50)
         at oracle.apps.XMLPublisher.client.XMLFileGenerator.main(XMLFileGenerator.java:62)
    Process exited with exit code 1.
    Thanks by advance for your help

    Make sure you have the Oracle JDBC library setup in project parties and it's setup to export. The api's are fine. Have you looked at the BIPublisherIDE I wrote. All this code is already written for you. There is a manual on the site as well
    http://bipublisher.blogspot.com/2008/03/bi-publisher-bipublisheride.html
    Ike Wiggins
    http://bipublisher.blogspot.com

  • Problem displaying Arabic characters in PDF using Java APIs

    We are experiencing a problem when attempting to display Arabic characters within a PDF document using the Java APIs.
    The relevant Java code is as follows:
    RTFProcessor processor = new RTFProcessor("example.rtf" );
    processor.setOutput( “example.xsl” );
    processor.setExtractXLIFF(true);
    processor.process();
    ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
    DataProcessor dataProcessor = new DataProcessor();
    dataProcessor.setDataTemplate( example.xdt" );
    if( parameterValues != null && parameterValues.length > 0 )
    setReportParameters( dataProcessor, parameterValues ); // method to set any report parameters from the parameterValues list.
    dataProcessor.setConnection( jdbcConnection );
    dataProcessor.setOutput(dataOut);
    dataProcessor.processData();
    FOProcessor foProcessor = new FOProcessor();
    foProcessor.setLocale( locale );
    foProcessor.setData( new ByteArrayInputStream( dataOut.toByteArray() ) );
    foProcessor.setTemplate( “example.xsl” );
    String xliffFileNameAndPath = getXLIFFFile( “example”, locale );
    if( xliffFileNameAndPath != null )
    foProcessor.setXLIFF( xliffFileNameAndPath );
    foProcessor.setOutput( "example.pdf" );
    foProcessor.setOutputFormat(
    outputFormat == PDF_FORMAT ? FOProcessor.FORMAT_PDF : FOProcessor.FORMAT_HTML );
    foProcessor.generate();
    The method getXLIFFFile( ) gets the relevant XLIFF file for the supplied report locale (if it exists) – the three test files that we used were Italian (example_it_IT.xlf), Spanish (example_es_ES.xlf) and Arabic (example_ar_AE.xlf).
    I imported the following JAR files from the XML Publisher release (version 5.6.2) into my Java application: collections.jar, i18nAPI_v3.jar, versioninfo.jar, xdocore.jar and xmlparserv2.jar.
    The output is OK for all three translations in HTML format, using a charset of UTF-8, and for Italian and Spanish in PDF format. However, the Arabic characters display as question marks in PDF format. The same issue occurs if I stream the output as a byte array straight to the HTTP response rather than save within a file.
    Note that the same RTF, XDT and XLIFF files produce the correct output in both HTML and PDF when executed within XMLPublisher.
    Thank you

    Hi
    I had a similar issue with arabic chars. With PDF layout, chars were appearing properly when preveiwd on local m/c, but as I implement file on server, it was displayed as ?????. I had raised a TAR 5798348.993 with oracle about this and they suggested to apply patch 4028294 Oracle Sourcing J Rollup and then patch 4182914. But later my users changed requirement and i cud not apply the patch to test if it works fine.
    But here, you have suggested that installing fonts would do. Is it really that simple? If yes, dont know what is that patch for which I was told to apply.
    Regards
    Varun

  • Best option to push Mass data using Java API

    Hi All,
    Can any one let me know how Java API push data to MDM? Is it a good option when ti comes to perfromance point of view? We have around 2000/5000 records to be imported every time using Java API and wondering what would be best way to acheive this using Java API?
    Is java API is best option than Web services?
    Thanks
    Rajeev

    Rajeev,
    It is perfectly fine to use API to push data into MDM, you just need to make sure that your API does all those tasks which import manager does by default. For example, it should know when to insert and when to update. if an error happens during insertion of record, you should be able to notify the users.
    Having said that, where does the number 2000/5000 comes in? will you be creating users in batch and then invoke MDM API to store these in a single shot or willl it be a delta insert/update from Java to MDM?
    Thanks
    Aamir

  • National characters and new Java API

    Hi All,
    I'm looking for your experience with new java api and national characters (like: ü, &#347;, &#263;, etc.). The problem is that when record was updated using MDM Data Manager, and retrieved using new java api - national character are invalid (in java string the national character are represented incorrectly).
    It's strange due to fact that when I create or update this record from java API it's looks fine. Second finding is that old java api (MDM4J) works fine on text fields with national characters.
    Maybe I forget to set something in server configuration / repository / or on java api connection - any help appreciated...
    Regards, marcin

    While retrieving data via the Java API 2,
    you should set the Unicode Normalization after the user session is authenticated.
    I guess this is available in SP5 patch.
    The documentation for this is available at
    https://help.sap.com/javadocs/MDM/current/index.html
    Package: com.sap.mdm.commands
    SetUnicodeNormalizationCommand cmd = new SetUnicodeNormalizationCommand(connectionAccessor);
    cmd.setSession(userSession);
    <b>cmd.setNormalizationType</b>(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);
    cmd.execute();
    This command is used to set the Unicode normalization.  This is used for the lifetime of the session. It should be set after the session is authenticated.
    Unicode normalization is important when a text string is represented differently depending on the normalization used. The MDM server always store text strings in one normalization format. An user providing a text string to the MDM server and later on tries to retrieve back the same text string might get the text string back in a different normalization. To resolve this issue, the user can use this class to specify the normalization the user wants to work with. The MDM server will always return text strings in the normalization specified by this class.

Maybe you are looking for

  • Header Data in Report

    hi gurus, my header data is too long and when i display my report, the header data gets truncated. May i know how can it be solved? Please advise and hopefully with sample codes. Thanks very much. Example: header data: Waiting for engr assigned/ Rece

  • WebLogic Portal and Workshop 9.2 Beta is Live!

    Hello All - We're excited to announce the public availability of the WebLogic Workshop and WebLogic Portal 9.2 open Beta release on bea.com. A beta version of the electronic documentation has also been posted to e-docs. Portal 9.2 adds significant ne

  • Quote in a  concatenated query

    Hi ALL, I am not thinking straight here. Is anyone out there to help ?. if I want to create a temp collection with the following query, with a character field ( :P_name) how do I get around this single quote issue ? If typed in KING the error is ORA-

  • I have 2 AppleIDs (1 from itunes

    I have 2 AppleIDs - Original from itunes & now a 2nd one from migrating from Mobile me. Can I merge the 2? My purchases are on the original ID yet my email, contacts & calendar are on the new one. Setting up iMessage & Photo Streaming drove me crazy

  • Problem importing WSDL having the namespace morethan 60 chars

    Hi all, I tried to import a WSDL file in external definition of namespace more than 60, it didn’t show me any error but I was not able to see the message objects. When I change the namespace and then tried to import it I am getting the message object