Code to access db2e databse from java  ?

i am woking on MAM application of SAP MI

Hai,
how do you want to access the database.
u want code for JDBC.
Different 4 types of drivers r there.
give more info.
for MYSQL
   Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            catch (Exception exc) {
        System.err.println("Exception in init(): Unable to load JDBC driver");
                 exc.printStackTrace();
            try {
                 conn = DriverManager.getConnection("jdbc:mysql://localhost/" + DBNAME);
FOR ORACLE
// Connection conn = new oracle.jdbc.driver.OracleDriver().
         //                     defaultConnection ();
      Connection  conn = DriverManager.getConnection(connStr,
                                           "scott", "tiger");
      Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("SELECT  DIVISION, COMPLAINT, " +
                           " CPU_CODE ,COMP_DT FROM scott.Bug ");
come back for more info.good luck

Similar Messages

  • 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

  • ADF mobile: access app preferences from java

    Hi,
    Jdev 11.1.2.3.0 + mobile extension.
    Where I can find example code or documentation to access preferences (configured in adfmf-application.xml) from java code?
    regards
    Peter

    Thanks!
    It's following part of the document:
    "At the Java layer, an EL value expression is resolved using the following
    approach:
    String val =
    AdfmfJavaUtilities.evaluateELExpression("#{preferenceScope.feature.f0.vendor}")
    regards
    Peter

  • How to access physical files from java platform

    Hello All,
    We have one JDE Word Writer program, which export the order master data in the DB2/400 Physical files.
    We want to access this data from our java program (reside on windows platform). I am wondering how we can do that. I got one hint that can be accessed by ODBC connection. But I am unable to get the correct ODBC driver. I am looking for correct driver to access the data.
    If some one has done this already, please help me. Or suggest me any alternate way.
    Dinesh

    Can use File class to write code to examine and manipulate file.
    Tutorial: http://java.sun.com/docs/books/tutorial/essential/io/file.html

  • XMLAnalysis Error while trying to execute a MDX query on MS SSAS - Accessing the cube from Java through Olap4j driver

     Am trying to access MS SSAS data cube from Java through olap4j driver(through msmdpump.dll). I am able to connect , but when I try to execute a query, i am getting the below error: Please help
    me out . (I tested the http://XXXX/OLAP/msmdpump.dll in MS Excel , and it is working fine)
    org.olap4j.OlapException: XMLA provider gave exception: <soap:Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode>
    XMLAnalysisError.0xc10a0004
    </faultcode>
    <faultstring>
    The CRASHDWHSRG cube either does not exist or has not been processed.
    </faultstring>
    <detail>
    <Error Description="The CRASHDWHSRG cube either does not exist or has not been processed." ErrorCode="3238658052" HelpFile="" Source="Microsoft SQL Server 2012 Analysis Services">
    </Error>
    </detail>
    </soap:Fault>

    See my other answer where you asked this same question on another thread
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/22dfc400-668d-4bd4-b76d-7c6b9ddda47a/msmdpumpdll-not-getting-registered?forum=sqlanalysisservices
    http://darren.gosbell.com - please mark correct answers

  • "access denied" error from Java Web Start

    I can successfully download the jar file, but always have error message "access denied" when the java application tries to open a local file in C:\temp\poc1.xml.
    I can successfully execute the java application from DOS,but failed when using Java Web Start. The error message is as follows:
    Java Web Start Console, started Wed Nov 28 16:30:31 PST 2001Java 2 Runtime Environment: Version
    1.3.1 by Sun Microsystems Inc.java.security.AccessControlException: access denied
    (java.io.FilePermission C:\temp\poc1.xml read)     at
    org.apache.xerces.framework.XMLParser.parse(Unknown Source)     at
    org.apache.xerces.framework.XMLParser.parse(Unknown Source)     at
    com.hotlocker.client.HLSessionParser.parse(Unknown Source)     at
    com.hotlocker.client.UploadDownloadClient.uploadFiles(Unknown Source)     at
    com.hotlocker.client.UploadDownload.main(Unknown Source)     at
    java.lang.reflect.Method.invoke(Native Method)     at
    com.sun.javaws.Launcher.executeApplication(Unknown Source)     at
    com.sun.javaws.Launcher.executeMainClass(Unknown Source)     at
    com.sun.javaws.Launcher.continueLaunch(Unknown Source)     at
    com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)     at
    com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)     at
    com.sun.javaws.Launcher.run(Unknown Source)     at java.lang.Thread.run(Unknown Source)

    Hi,
    you can't get a file like in a "normal" app
    because a JWS-app runs in the restricted
    sandbox environment by default.
    So you either sign your app with a digital certificate
    or you use a special FileOpenService (JNLP-API).
    You could also put the file into the app-jar and
    load it by a classloader.
    Regards,
    Mathias

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

  • UnsatisfiedLinkError - Trying to access a DLL from Java

    I am trying to use the Java Native Interface (JNI) to run some C++ code from Java. I tried a simple test program to teach myself that, and it worked perfectly. However, now that I'm tackling a bigger project (A data acquisition program), I get an UnsatisfiedLinkError in the line that calls the function from the DLL.
    Here is the stacktrace: Exception in thread "AWT-EventQueue-0" java.lang.Error: java.lang.reflect.Invoca
    tionTargetException
            at org.jdesktop.application.ApplicationAction.actionFailed(ApplicationAc
    tion.java:859)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(App
    licationAction.java:665)
            at org.jdesktop.application.ApplicationAction.actionPerformed(Applicatio
    nAction.java:698)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
    95)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(App
    licationAction.java:662)
            ... 26 more
    Caused by: java.lang.UnsatisfiedLinkError: fileiotest.dllinterface.startget()V
            at fileiotest.dllinterface.startget(Native Method)
            at fileiotest.dllinterface.start_daq(dllinterface.java:26)
            at fileiotest.FileIOTestView.startrun(FileIOTestView.java:680)
            ... 31 moreI have made sure that the DLL is in the classpath, using both the -classpath tag and by setting the PATH variable. Is something wrong with my DLL itself, perhaps?

    Yes, I have.
    I didn't include the code yet because I thought if someone had similar trouble, there might be something obvious I am overlooking and they wouldn't even need to see the code. I can provide it, however.
    This is the C++ DLL
    // consoledaq.cpp : Defines the entry point for the console application.
    #include <windows.h>                    /* Compiler's include files's */
    #include <string.h>                  
    #include <stdio.h>
    #include "cbw.h"
    #include "stdafx.h"
    #include "dllinterface.h"
    #include "jni.h" //can copy or give full path
    #include <math.h>
    BOOL APIENTRY DllMain( HANDLE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
        return TRUE;
    #define BOARD_NUM      0                /* Number of A/D board as defined with InstaCal */
    #define BUF_SIZE       10048            /* Size of buffer */
    #define NUM_SECS       10                /* Number of secs to collect data */
    #define ADRANGE        BIP5VOLTS        /* A/D voltage range */
    #define TIMER_NUM      1                /* Windows timer used by this program */
    static HGLOBAL  MemHandle32;       
    /* Variables for AinScan */
    static unsigned short *ADValues;    /* Win32 pointer to A/D buffer */
    static HGLOBAL   ADMemHandle;
    static short     ADCurStatus;       /* Current status for D/A scan */
    static long      ADCurCount;        /* Current count for A/D scan  */
    static long      ADCurIndex;        /* Current index for A/D scan  */
    int              ADOptions;
    long       Count, Rate;
    float      Voltage, Voltage2;
    unsigned short CurValue, CurValue2;
    JNIEXPORT void JNICALL
    Java_daq_startget(JNIEnv *env, jobject obj)
         cbErrHandling (PRINTALL, STOPALL);  /* Set library's error handling */
         ADCurStatus = RUNNING;
         ADCurIndex = 0l;
         ADCurCount = 0l;
         /* Allocate A/D Windows buffer */
         ADMemHandle = cbWinBufAlloc ((long)BUF_SIZE);
         /* Allocate a local WIN32 buffer to hold A/D Data */
         MemHandle32 = GlobalAlloc(GMEM_FIXED | GMEM_DDESHARE, BUF_SIZE *sizeof(short));
         /* Get a 32-bit pointer to the A/D WIN32 buffer */
         ADValues = (unsigned short *)GlobalLock(MemHandle32);
         /* Start up background A/D scan */
         Count = BUF_SIZE;
         Rate = BUF_SIZE / (NUM_SECS * 2);
         ADOptions = BACKGROUND | CONTINUOUS;
         cbAInScan (BOARD_NUM, 0, 1, Count, &Rate, ADRANGE, ADMemHandle, ADOptions);
    JNIEXPORT void JNICALL
    Java_daq_stopget(JNIEnv *env, jobject obj)
         cbStopBackground(BOARD_NUM, AIFUNCTION);  /* Stop A/D subsystem background scan */
         if (ADMemHandle)                 
              cbWinBufFree (ADMemHandle);   /* Free allocated memory */
         if (MemHandle32)
              GlobalFree (MemHandle32);
    JNIEXPORT jfloatArray JNICALL
    Java_daq_getpoint(JNIEnv *env, jobject obj)
         jfloatArray theArray;
         if (ADCurIndex >= 0)
              /* Copy Data from memory to 32 bit memory buffer */
              cbWinBufToArray(ADMemHandle, &ADValues[ADCurIndex], ADCurIndex ,2);
              CurValue = ADValues[ADCurIndex];
              CurValue2 = ADValues[(ADCurIndex + 1)];
         else
              CurValue = 0;
              CurValue2 = 0;
         jfloat tmp[2];
         theArray =  env->NewFloatArray(2);
         cbToEngUnits(BOARD_NUM,ADRANGE,CurValue,&Voltage);                      
         cbToEngUnits(BOARD_NUM,ADRANGE,CurValue2,&Voltage2);
         tmp[0] = Voltage;
         tmp[1] = Voltage2;
         env->SetFloatArrayRegion(theArray, 0, 2, tmp);
         return theArray;
    }And this is the Java class:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package fileiotest;
    * @author Owner
    public class dllinterface {
        public native void startget();
        public native float[] getpoint();
        public native void stopget();
        static {
         System.loadLibrary("daqdll");//This is firstJNI.DLL
         /*if generated by borland
         System.loadLibrary("firstjni");//This is firstjni.dll
        public static void start_daq()
            dllinterface DI=new dllinterface();
            DI.startget();
        public static void stop_daq()
            dllinterface DI=new dllinterface();
            DI.stopget();
        public static float[] get_data_point()
          dllinterface DI=new dllinterface();
          float newtempfloat[];
          newtempfloat = DI.getpoint();
          return newtempfloat;
    }

  • Accessing  table type from JAVA

    Hi Experts,
    We are making a custom copy of the std FM COM_BPUS_ORG_CONTPERS_REGISTER .
    It is observed that Tables are obsolete and we should not use them in custom function modules.
    I can pass a table type in import parameter and export parameter.
    Can we access a table type from java layer.
    Also, note that this STANDARD function module has parameter IT_BUSINESSPARTNERROLE_ORG which has table type BU_ROLE_T.
    Is it possible to access this?
    Note:- This Function module is not getting called in standard web shops.
    Please let me now how i can access this table type for hava while calling FM so as to input or retrieve valus from it.
    Regards
    Antony

    The issue with you is more than accessing a table type.
    You said:
    This Function module is not getting called in standard web shops.
    For function modules that are not called as a part of the standard flow, you have to develop your own simple BOM, BO, BEI, BE classes and methods to call the custom RFC - the whole nine yards. See the extension guide and see the Extension Demos 2 and 3 for reference.
    See the sample JCO calls from Java to understand how to access the table types.

  • How to access system calls from java program?

    i am having a doubt regarding accessing system calls from a Java program like accessing unix system calls from a c program.

    Runtime.getRuntime().exec("line command here");
    example:
    Runtime.getRuntime().exec("ls -la");

  • Accessing DLL files from Java

    I have a problem with Java, and the problem is that I'm trying to call a DLL file declared by C++ only but without a support for Java programs, is what I'm aiming for going to be available by using the rundll32.exe file.
    Note: I'm trying to use the (skydll.dll) file for controling skystar2 DVB card.
    Message was edited by:
    JZoro

    You cannot directly call a DLL from Java unless the DLL exposes entry points that are compatible with the JNI calling conventions.
    For example a Java class calling a native function like below:
    class Arguments
       private native void setArgs (String[] javaArgs);
       public static void main (String args[])
          Arguments A = new Arguments();
          newArgs[] = A.setArgs(args);
       static
          System.loadLibrary("MyArgs");
    }Needs a DLL entry point with the following signature:
    JNIEXPORT void JNICALL
    Java_Arguments_setArgs (JNIEnv *jenv, jobject job, jobjectArray oarr) {Notice that the first parameter of the method is of type JNIEnv and the second can be either a reference to a class or Java object instance.
    Jacques Gonzalez
    J4SOFT

  • Accessing ACTIVE DIRECTORY FROM JAVA CODE

    I am trying to access the Active DIrectory user through a java code.
    Kindly let me know the steps apart from creating the user in ADS to be followed so that the following java code may work.
    presently it is giving the following error.
    problem serching the directory
    //package com.axa;
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    public class AdHelper
         public static void main(String args[])
    System.out.println("1");
              Hashtable env = new Hashtable();
              String adminName = "CN=user,CN=Users,DC=BDC4AXA.CO.IN";
              String adminPassword = "user";
              String ldapURL = "ldap://10.1.242.51:636";
    System.out.println("2");
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              env.put(Context.PROVIDER_URL,ldapURL);
    System.out.println("3");
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialLdapContext(env,null);
    System.out.println("4");
                   SearchControls searchCtls = new SearchControls();
              System.out.println("5");
                   //Specify the attributes to return
                   String returnedAtts[]={"sn","givenName","mail"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(mail=*))";
    System.out.println("6");
                   //Specify the Base for the search
                   String searchBase = "DC=ANTIPODES,DC=COM";
    System.out.println("7");
                   //initialize counter to total the results
                   int totalResults = 0;
                   // Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
    System.out.println("8");               //Loop through the search results
                   while (answer.hasMoreElements()) {
              SearchResult sr = (SearchResult)answer.next();
                   totalResults++;
    System.out.println("9");
                   System.out.println(">>>" + sr.getName());
                   Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                             System.out.println(" surname: " + attrs.get("sn").get());
                             System.out.println(" firstname: " + attrs.get("givenName").get());
                             System.out.println(" mail: " + attrs.get("mail").get());
                             catch (NullPointerException e)     {
                             System.out.println("Errors listing attributes: " + e);
                   System.out.println("Total results: " + totalResults);
                   ctx.close();
                   catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
              catch(Exception e)
                   System.out.println("Unhandled Exception: " + e);
    }

    This is what I have for my LDAP connection.
    public Hashtable<String, String> env = null;
         public LdapContext ldapContext = null;
         public Control[] connCtls = null;
         Context ctx;
         DirContext dirContext;
    public LDAPAuth(String ldapurl) {
              ldapurl = "ldap://" + serverIP + ":389";
              try {
                   env = new Hashtable<String, String>();
                   env.put(Context.INITIAL_CONTEXT_FACTORY,
                             "com.sun.jndi.ldap.LdapCtxFactory");
                   env.put(Context.SECURITY_AUTHENTICATION, "simple");
                   env.put(Context.PROVIDER_URL, ldapurl);
                   env.put(Context.SECURITY_PRINCIPAL, "cn=username,cn=users" + baseName);
                   env.put(Context.SECURITY_CREDENTIALS, "password" + baseName);
                   env.put(Context.SECURITY_PROTOCOL, "ssl");
                   ctx = new InitialContext(env);
              } catch (Exception e) {
                   System.out.println(" bind error: " + e);
                   e.printStackTrace();
              try {
                   ldapContext = new InitialLdapContext(env, connCtls);
              } catch (AuthenticationException e) {
                   System.out.println("Authentication exception " + e);
              } catch (NamingException e) {
                   System.out.println("Naming exception " + e);
         public Attributes fetch(String username) throws NamingException {
              DirContext ctx = new InitialDirContext(env);
              Attributes attributes = ctx.getAttributes(username);
              try {
                   System.out.println("fetching: " + username);
                   Object obj = ctx.lookup("cn=" + username
                             + baseName);
                   System.out.println("cn=" + username + baseName + "is bound to: " + obj);
                   //attributes = obj.getAttributes("");
                   for (NamingEnumeration<?> ae = attributes.getAll(); ae
                             .hasMoreElements();) {
                        Attribute attr = (Attribute) ae.next();
                        String attrId = attr.getID();
                        for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore();) {
                             String value = vals.next().toString();
                             System.out.println(attrId + ": " + value);
              } catch (NamingException e) {
                   System.out.println(" Problem looking up " + username + baseName + ". " + e);
              return attributes;
    Now, I'm sure it has something to do with how I'm passing in the username and the groups. But I want to have ANY user log in, not just this test. I may be a little confused on how this works, but if anyone could explain to me why what I am trying to do doesn't work, I would greatly appreciate it.
    Thanks in advance,
    Tetsuya.
    Edited by: tetsuyamasamune on Sep 8, 2008 3:55 PM

  • Proplem: Access HTMLB controls from java code

    Hi,
    I am new to iView development for EP6. So my problem should be easy to solve (for you ).
    I created in the NW Dev Studio a JSP DynPage.
    The following files were created or edited:
    1.     JSP file (created)
    2.     java file (created)
    3.     portalapp.xml (edited)
    In order to make the page running (proccessing) I changed the following things:
    1.     JSP file – Add taglib reference to HTMLB-class
    2.     portalapp.xml – Remove the „native“ property so the JSP file will not be accessed directly.
    Now I want to do the following:
    On the JSP page I placed severeal HTMLB controls (textViews).
    From the java code I try to access these controls in the „doProcessBeforeOutput“ method and change/set values.
    But I get all the time a null-Exception.
    Code (JSP)
    <%-- mcmsprovider.jsp --%>
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    <hbj:content id="cntMcmsProvider" >
      <hbj:page title="MCMS Provider Dynpage">
       <hbj:form id="frmMcmsProvider" >
                 <hbj:textView id="tvwScript" encode="false"></hbj:textView>
                 <hbj:textView id="tvwStyle" encode="false"></hbj:textView>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    Code (JAVA):
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
           TextView tvw = (TextView) this.getComponentByName("tvwStyle");
           tvw.setText("Here the dynamic text");
    I also tried to add raw text to the form but also null excpetion:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
           Form frmCurrent = (Form) this.getForm();
           frmCurrent.addRawText("<h3>This comes from here</h3>");
    My goal is to dynamically add controls to the form, but until now I think it will be a dream:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
      Form form = (Form)this.getForm();
           TextView tvw  = new TextView("tvwDynamic");
           tvw.setText("Here the dynamic control");
           form.addComponent(tvw);
    The normal page processing runs:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
    Any help is greatly appreciated.

    Eike
    Here is the example straight from the PDK documentation. This should help you a little
    UsingAbstractPortalComponentWithHTMLB.java
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.DataType;
    import com.sapportals.htmlb.enum.GroupDesign;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.rendering.IPageContext;
    import com.sapportals.htmlb.rendering.PageContextFactory;
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    public class UsingAbstractPortalComponentWithHTMLB extends AbstractPortalComponent {
        //Fill in your output for "normal" content creation mode here
        protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response) {
            IPageContext myContext = PageContextFactory.createPageContext(request, response);
            if (myContext == null) {
                System.out.println("htmlb service did not start up as expected.");
            Form myForm = myContext.createFormDocument("First Experiment");
            Event lastEvent = myContext.getCurrentEvent();
            Group myGroup = new Group();
            myGroup.setWidth("350");
            myGroup.setTitle("First Experiment");
            myGroup.setDesign(GroupDesign.SAPCOLOR);
            myForm.addComponent(myGroup);
            GridLayout gl = new GridLayout();
            myGroup.addComponent(gl);
            if ((lastEvent != null) && (lastEvent.getComponentName().equals("submit"))) {
                String name = myContext.getDataForComponentId("USER_NAME").toString();
                TextView label = new TextView("Hi, " + name);
                gl.addComponent(1, 1, label);
                Button myButton = new Button("goback", "Go back");
                myButton.setOnClick("goBack"); // ignored anyway
                gl.addComponent(2, 1, myButton);
            } else {
                TextView label = new TextView("What's your name?");
                gl.addComponent(1, 1, label);
                InputField inf = new InputField("USER_NAME");
                inf.setType(DataType.STRING);
                gl.addComponent(1, 2, inf);
                Button myButton = new Button("submit", "Tell");
                myButton.setOnClick("submit");
                gl.addComponent(2, 2, myButton);
            myContext.render();

  • Accessing .properties file from java code

    Hi,
    I want my java code in a Tomcat Web Application to access values in a custom .properties file.How can i do it.
    Any sample code / suggestions welcome.
    Thanks
    Vignesh.

    ResourceBundle vResourceBundle = ResourceBundle.getBundle("database", Locale.ENGLISH);
            sDriverName = vResourceBundle.getString("database.DriverName");
            sDbURL = vResourceBundle.getString("database.DriverUrl");
            sDbUser = vResourceBundle.getString("database.UserName");
            sDbPasswd = vResourceBundle.getString("database.PassWord");Where "database" is the name of the property file. ie., database.properties.
    the content of the database.properties file
    # Properties to access dabase                 
    database.UserName = scott
    database.PassWord = tiger
    database.DriverName = oracle.jdbc.driver.OracleDriver
    database.DriverUrl = jdbc:oracle:thin:@nn.nn.nn.nn:port:orartgnull

  • MS Access Date problem (from Java program)

    I have written an app. in Java that reads & writes data from a MS Access database.
    I am trying to write an insert class which will add a row of data to one of my database tables - which contains Date fields.
    My problem is that I can update the text fields, but not Date fields - every time I try my program throws an exception:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    My simplified code reads as:
    try {
    Statement insertStatement = databaseConnection.createStatement();
    String query = "INSERT INTO myTable(jobId, employeeId, date) VALUES('11', '1', " + "'13/11/2006'" + ");";
    insertStatement.execute(query);
    } //close, etc. etc.
    If I remove the date info from the query, the program executes successfully. I appreciate my problem might be related to the formatting of the date in Access, and if not a 'proper' Java question I give my apologies.
    I have attempted several formats of the date with no success or variation in the exception.
    I am, however, completely stuck and would appreciate any and all help given.
    Regards and thanks
    David

    I have amended my code to use a preparedStatement, but on execution I have the same problem.
    My code is as follows:
    PreparedStatement pstmt = null;
    try {
    String query = "INSERT INTO myTable (jobId, employeeId, date) VALUES(?, ?, ?);";
    pstmt = databaseConnection.prepareStatement(query);
    pstmt.setString(1, "11");
    pstmt.setString(2, "1");
    java.sql.Date sqlDate = getCurrentJavaSqlDate();
    pstmt.setDate(3, sqlDate);
    // execute query, and return number of rows created
    int rowCount = pstmt.executeUpdate();
    System.out.println("rowCount=" + rowCount);
    pstmt.close();
    catch, etc. etc.
    Any ideas or help most welcome
    Regards
    David

Maybe you are looking for

  • IPhone 4S 32Gb IOS 5.1.1

    Dear support, recently my iPhone 4S 32Gb IOS 5.1.1 having problem with SOUND, all application have no sound at all, games, keyboard, etc. But still can hear music and phone call. Maybe, somebody in this communities ever have the same problem..... Ple

  • How to activate Image, Pdf, Hyperlink and Scale Prices in SRM-MDM

    Hi Experts, I have requirement to activate the following features: 1. Image 2. PDF 3. Hyperlink 4. Scale Prices These should be activated and should be available in the current business' internal catalogs so that users could be able to easily identif

  • Text messed up

    Why does Safari look like this on my computer, and how can i fix it? Windows XP   Windows XP  

  • CS4 technical requirements, help needed

    I am a complete novice when it comes to stuff like this, so I apologise in advance if the question I'm about to ask may seem a bit stupid. I saw the following technical requirements for Adobe CS4: 2GHz or faster processor for DV; 3.4GHz for HDV; dual

  • Connecting Oracle DataBase through WebDynpro

    Hi, I created a Dynamic table, now I should display the data from Oracle Database. I tried in many various ways to connect to database, but the data is not retrieving. Can u explain the reasons and give necessary coding to retrieve the data. Its very