How to use ButeBuffer properly in java code

hi,
i am trying to use a bytebuffer and i don't kniow which methods allow reading its content...i need to retrieve this content in order to convert it ( byte by byte) into RGB values...so can anyone help me to do it please?

The API documentation tells you exactly which methods are available in class java.nio.ByteBuffer.

Similar Messages

  • How to Use Exec function in Java Code

    How to Use Exec method
    I want to Execute command
    net Start "some service"
    using exec method of runtime class
    or i use some other way if suggest

    Assuming you have read http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.String) already, I can only suggest to be more specific in what your problems are. If you are after just some example code, then download ftp://ftp.ebi.ac.uk/pub/software/textmining/monq/monq.tar.gz and have a look at the source code of monq.stuff.Exec. It does all those things which are necessary to keep track of a Process after it was created with exec.
    Harald.
    BioMed Information Extraction: http://www.ebi.ac.uk/Rebholz-srv/whatizit

  • How to use Oracle objects in java code

    Hi all!
    I'm reading an xls and i need to fill me oracle objects with java code:
    OBJECT_NAME OBJECT_TYPE
    LETTURA_OBJ TYPE
    LETTURA_OBJ TYPE BODY
    In the past weeks i've been using both java code into oracle and oracle objects, but new i need to write those objects with data i read with java, anybody can help me?
    I know that the easiest work around would be to put the data i read from the excel file into a table and then fill the oracle objects, but now i want to learn how to write directly those objects with a command like the following one:
    a sample of the code i'm tryng to write:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import jxl.*;
    public cass ....
    #sql{  variabili_globali.var_ER_F3.Tipo_Lettura := 5}
    thanks,
    Massimo
    Edited by: LinoPisto on 16-mag-2011 16.38

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • How to use odi variable in java code.

    Hi,
    I am trying to calculate check sum of a file and need to capture that in a odi variable...
    I wrote code like this(selected technology as java bean shell)
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    #checksum = cis.getChecksum().getValue();
    }@>
    But I am not able to get that value...
    I tried in another way like this
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
         long result;
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result= cis.getChecksum().getValue();
    @>
    In odi variable refreshing mode i selected schema as memory_engine and wrote
    select '<@=result@>' from dual;
    even this wont work for me :(
    Anyone pls help me in this...
    Thanks in advance
    Pavan

    Hi Phani,
    Thanks for the reply. I resolved this. The mistake is I wrote java code in a class,in main function. I removed class and main function. Now I am able to capture value into Odi variable...
    I modified code as
    <@
    import java.io.*;
    import java.util.zip.*;
         long result;
    FileInputStream fis = new FileInputStream(new File("C:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result=cis.getChecksum().getValue();
    @>
    finally retrieving result value from dual
    select '<@=result@> from dual
    Edited by: 908443 on Jan 16, 2012 10:42 PM

  • How to use the XULRunner with JAVA Code

    Hi, all
    I have a big problem about XULRunner. I can not find a nice solution on the internet. So I have to request you to give me some ideas.
    We know the XULRunner is nice solution when we want to embed a browser into desktop program which is thunderbird, firefox and so on.
    My questions are the following:
    1. Can I execute a Java function accross the JAVASCript? We can execute javascript code in the JAVA, but I'm not sure I can do opposite it.
    2. What is javaxpcom?
    If you did program like this, please give me some ideas, thanks very much.

    I marked this as "off-topic" since it's not a Firefox support question.
    Another place for discussion related to XULRunner, besides the Mozilla community links at https://developer.mozilla.org/en-US/docs/Mozilla/Projects/XULRunner might be one of the [http://forums.mozillazine.org/ MozillaZine forums], such as the Mozilla Development forum:
    *http://forums.mozillazine.org/viewforum.php?f=27
    EDIT: I'm leaving this question open since it's about another Mozilla product and I'm escalating it to the Helpdesk in case anyone over there has a suggestion.

  • How to use sql query in java ?

    i don't know how to use sql query in java code.
    who can give me some advice?
    thanks

    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • How to use C-Structure in java applets

    hi alls,
    I want to use a struct model (struct in C++) in java applets. i know class is used in java applications. but, how can i convert in java applets?
    class renk
    int r;
    int gr;
    int b;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.Event;
    import java.applet.Applet;
    public class benek extends Applet
    final int n=10;
    int x[] = new int[n];
    int y[] = new int[n];
    int count = 0;
    renk clr[] = new renk[n];
    public void init()
    setBackground(Color.black);
    public boolean mouseDown(Event yordam, int xyer, int yyer)
    if (count<n)
    System.out.println("...");
    ekle(xyer,yyer);
    else System.out.println("Kapasite Doldu...");
    return true;
    void ekle(int xyer, int yyer)
    int r1 = (int)Math.floor(Math.random()*256);
    int gr1 = (int)Math.floor(Math.random()*256);
    int b1 = (int)Math.floor(Math.random()*256);
    clr[count].r = r1;
    clr[count].gr = gr1;
    clr[count].b = b1;
    x[count]=xyer;
    y[count]=yyer;
    count++;
    repaint();
    public void paint(Graphics g)
    it gives error message... how can � use struct model in java applets???
    if you help me i will be greatfull....

    � use import but it doesn't work.
    i add: import renk; or import class renk;
    how will � add import I assumed based on your initial post that the renk and benek classes were in the same file. Apparently you're saying they are not. So for another thing, make your renk class "public class renk", and add the "public" keyword to the 3 members of that class. Then if your code still doesn't see the "renk" class, it would just be that you don't have the directory that contains the compiled "renk.class" in your classpath.

  • How to Commit table by writting Java code in Managed Bean?

    Hi,
    Can anyone suggest me how to Commit table by writing Java code in Managed Bean?.
    I want to commit table manually after modifying in UI.
    Please suggest me guys.
    Thanks,
    Ramit Mathur

    Hi Friend Copy this two java files with same package of your bean package.
    1,*ADFUtils.java*
    package org.calwin.common.view.utils;(Your package name)
    import java.util.ArrayList;
    import java.util.List;
    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.MethodExpression;
    import javax.el.ValueExpression;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.model.binding.DCParameter;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.binding.AttributeBinding;
    import oracle.binding.BindingContainer;
    import oracle.binding.ControlBinding;
    import oracle.binding.OperationBinding;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.uicli.binding.JUCtrlValueBinding;
    * A series of convenience functions for dealing with ADF Bindings.
    * Note: Updated for JDeveloper 11
    * @author Duncan Mills
    * @author Steve Muench
    * $Id: ADFUtils.java 2513 2007-09-20 20:39:13Z ralsmith $.
    public class ADFUtils
    public static final ADFLogger _LOGGER = ADFLogger.createADFLogger(ADFUtils.class);
    * Get application module for an application module data control by name.
    * @param pName application module data control name
    * @return ApplicationModule
    public static ApplicationModule getApplicationModuleForDataControl(String pName)
    return (ApplicationModule) JSFUtils.resolveExpression("#{data." + pName + ".dataProvider}");
    * A convenience method for getting the value of a bound attribute in the
    * current page context programatically.
    * @param pAttributeName of the bound value in the pageDef
    * @return value of the attribute
    public static Object getBoundAttributeValue(String pAttributeName)
    return findControlBinding(pAttributeName).getInputValue();
    * A convenience method for setting the value of a bound attribute in the
    * context of the current page.
    * @param pAttributeName of the bound value in the pageDef
    * @param pValue to set
    public static void setBoundAttributeValue(String pAttributeName, Object pValue)
    findControlBinding(pAttributeName).setInputValue(pValue);
    * Returns the evaluated value of a pageDef parameter.
    * @param pPageDefName reference to the page definition file of the page with the parameter
    * @param pParameterName name of the pagedef parameter
    * @return evaluated value of the parameter as a String
    public static Object getPageDefParameterValue(String pPageDefName, String pParameterName)
    BindingContainer bindings = findBindingContainer(pPageDefName);
    DCParameter param = ((DCBindingContainer) bindings).findParameter(pParameterName);
    return param.getValue();
    * Convenience method to find a DCControlBinding as an AttributeBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pBindingContainer binding container
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(BindingContainer pBindingContainer, String pAttributeName)
    if (pAttributeName != null)
    if (pBindingContainer != null)
    ControlBinding ctrlBinding = pBindingContainer.getControlBinding(pAttributeName);
    if (ctrlBinding instanceof AttributeBinding)
    return (AttributeBinding) ctrlBinding;
    return null;
    * Convenience method to find a DCControlBinding as a JUCtrlValueBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(String pAttributeName)
    return findControlBinding(getBindingContainer(), pAttributeName);
    * Return the current page's binding container.
    * @return the current page's binding container
    public static BindingContainer getBindingContainer()
    return (BindingContainer) JSFUtils.resolveExpression("#{bindings}");
    * Return the Binding Container as a DCBindingContainer.
    * @return current binding container as a DCBindingContainer
    public static DCBindingContainer getDCBindingContainer()
    return (DCBindingContainer) getBindingContainer();
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute to use for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName, pDescriptionAttrName);
    * Get List of attribute values for an iterator.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName value attribute to use
    * @return List of attribute values for an iterator
    public static List attributeListForIterator(String pIteratorName, String pValueAttrName)
    return attributeListForIterator(findIterator(pIteratorName), pValueAttrName);
    * Get List of Key objects for rows in an iterator.
    * @param pIteratorName iterabot binding name
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(String pIteratorName)
    return keyListForIterator(findIterator(pIteratorName));
    * Get List of Key objects for rows in an iterator.
    * @param pIterator iterator binding
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(DCIteratorBinding pIterator)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getKey());
    return attributeList;
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIteratorName iterator binding name
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(String pIteratorName, String pKeyAttrName)
    return keyAttrListForIterator(findIterator(pIteratorName), pKeyAttrName);
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIterator iterator binding
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(DCIteratorBinding pIterator, String pKeyAttrName)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(new Key(new Object[]
    { r.getAttribute(pKeyAttrName) }));
    return attributeList;
    * Get a List of attribute values for an iterator.
    * @param pIterator iterator binding
    * @param pValueAttrName name of value attribute to use
    * @return List of attribute values
    public static List attributeListForIterator(DCIteratorBinding pIterator, String pValueAttrName)
    List attributeList = new ArrayList();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getAttribute(pValueAttrName));
    return attributeList;
    * Find an iterator binding in the current binding container by name.
    * @param pName iterator binding name
    * @return iterator binding
    public static DCIteratorBinding findIterator(String pName)
    DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(pName);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pName + "' not found");
    return iter;
    * @param pBindingContainer
    * @param pIterator
    * @return
    public static DCIteratorBinding findIterator(String pBindingContainer, String pIterator)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContainer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContainer + "' not found");
    DCIteratorBinding iter = bindings.findIteratorBinding(pIterator);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pIterator + "' not found");
    return iter;
    * @param pName
    * @return
    public static JUCtrlValueBinding findCtrlBinding(String pName)
    JUCtrlValueBinding rowBinding = (JUCtrlValueBinding) getDCBindingContainer().findCtrlBinding(pName);
    if (rowBinding == null)
    throw new RuntimeException("CtrlBinding " + pName + "' not found");
    return rowBinding;
    * Find an operation binding in the current binding container by name.
    * @param pName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pName)
    OperationBinding op = getDCBindingContainer().getOperationBinding(pName);
    if (op == null)
    throw new RuntimeException("Operation '" + pName + "' not found");
    return op;
    * Find an operation binding in the current binding container by name.
    * @param pBindingContianer binding container name
    * @param pOpName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pBindingContianer, String pOpName)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContianer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContianer + "' not found");
    OperationBinding op = bindings.getOperationBinding(pOpName);
    if (op == null)
    throw new RuntimeException("Operation '" + pOpName + "' not found");
    return op;
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName, pDescriptionAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return List of ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Find the BindingContainer for a page definition by name.
    * Typically used to refer eagerly to page definition parameters. It is
    * not best practice to reference or set bindings in binding containers
    * that are not the one for the current page.
    * @param pPageDefName name of the page defintion XML file to use
    * @return BindingContainer ref for the named definition
    private static BindingContainer findBindingContainer(String pPageDefName)
    BindingContext bctx = getDCBindingContainer().getBindingContext();
    BindingContainer foundContainer = bctx.findBindingContainer(pPageDefName);
    return foundContainer;
    * @param pOpList
    public static void printOperationBindingExceptions(List pOpList)
    if (pOpList != null && !pOpList.isEmpty())
    for (Object error: pOpList)
    _LOGGER.severe(error.toString());
    * Programmatic invocation of a method that an EL evaluates to.
    * The method must not take any parameters.
    * @param pEl EL of the method to invoke
    * @return Object that the method returns
    public static Object invokeEL(String pEl)
    return invokeEL(pEl, new Class[0], new Object[0]);
    * Programmatic invocation of a method that an EL evaluates to.
    * @param pEl EL of the method to invoke
    * @param pParamTypes Array of Class defining the types of the parameters
    * @param pParams Array of Object defining the values of the parametrs
    * @return Object that the method returns
    public static Object invokeEL(String pEl, Class[] pParamTypes, Object[] pParams)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    MethodExpression exp = expressionFactory.createMethodExpression(elContext, pEl, Object.class, pParamTypes);
    return exp.invoke(elContext, pParams);
    * Sets the EL Expression with the value.
    * @param pEl EL Expression for which the value to be assigned.
    * @param pVal Value to be assigned.
    public static void setEL(String pEl, Object pVal)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    exp.setValue(elContext, pVal);
    * Evaluates the EL Expression and returns its value.
    * @param pEl Expression to be evaluated.
    * @return Value of the expression as Object.
    public static Object evaluateEL(String pEl)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    return exp.getValue(elContext);
    }

  • Search information using a VO by java code..?

    Search information using a VO by java code.
    Hi to all
    Im trying to retrieve specific   information by java  using the VO object that I have attaché to the EO. I need to know if this is possible and how to.
    For example lest say that I have the following information user name and password and I wand the telephone and other information.
    Can some pls help me with a link of an example of how to do this.
    Tanks to all.

    Hi JulianeE
    Yes it is possbile, please generate the VORowImpl file on the corresponding VO object. Even if your query return multple rows, it can . see the sample code below
    OAViewObject vo1 = (OAViewObject)am.findViewObject("EmployeeEOVO1");
    vo1.reset();
    if (vo1 != null)
    do
    if(!vo1.hasNext())
    break;
    vo1.next();
    EmployeeEOVORowImpl lcerl = (EmployeeEOVORowImpl)vo1.getCurrentRow();
    lcerl.getFullName();
    Thanks
    Sandeep

  • How to use parrallel cursor in this code

    hi can anyone expalin me how to use parallel cursor for this code ... 
    loop at itabkpf.
          read table ibsegpar_fu with key
                     belnr = itabkpf-belnr
                     gjahr = itabkpf-gjahr
                     bschl = '25' .
    Start insert by Pradeep 20082008
          sort: itabkpf by belnr,
                itabsegpar by belnr.
    End insert by Pradeep 20082008
          if sy-subrc = 0. "Deleted by pradeep 20082008
            select bukrs belnr gjahr bschl koart lifnr wrbtr
                   wskto pswbt zfbdt augbl augdt sgtxt rebzg rebzj
                   into corresponding
                   fields of table ibsegpar_fu_1 from bseg
                   where bukrs = itabkpf-bukrs and
                   belnr = itabkpf-belnr and
                   gjahr = itabkpf-gjahr and
                   augbl <> itabkpf-belnr and
                   rebzg <> space and
                   bschl = '25'.
            loop at ibsegpar_fu_1.
    Start insert by Pradeep 20082008
              sort ibsegpar_fu_1 by belnr.
    End insert by Pradeep 20082008
              move-corresponding ibsegpar_fu_1 to itabseg.
              move ibsegpar_fu_1-belnr to itabseg-augbl.
              move ibsegpar_fu_1-rebzg to itabseg-belnr.
              move ibsegpar_fu_1-rebzj to itabseg-gjahr.
    *********to include code to pick the description for partical payment
              select single * from bseg where
                  bukrs = ibsegpar_fu_1-bukrs and
                  belnr = ibsegpar_fu_1-belnr and
                  gjahr = ibsegpar_fu_1-gjahr and
                  augbl <> ibsegpar_fu_1-belnr and
                  rebzg = space and
                  bschl <> '25'.
              move bseg-sgtxt to itabseg-sgtxt.
              clear bseg.
    *********end of code
              itabseg-wrbtr = itabseg-wrbtr * -1.
              itabseg-pswbt = itabseg-pswbt * -1.
              select single budat into lsdat from
                   bkpf where bukrs = ibsegpar_fu_1-bukrs and
                   belnr = ibsegpar_fu_1-rebzg and
                   gjahr = ibsegpar_fu_1-rebzj.
              if sy-subrc = 0.
                move lsdat to itabseg-zfbdt.
              endif.
              append itabseg.
            endloop.
          endif. "Deleted by Pradeep 20082008
        endloop.
        loop at ibsegpar_fu.
          sort ibsegpar_fu by belnr. " insert by pradeep
          move-corresponding ibsegpar_fu to itabseg.
          select bukrs belnr gjahr bschl koart lifnr wrbtr
                 rebzg rebzj sgtxt into corresponding
                 fields of table ibsegpar_fu_1 from bseg
                 where  bukrs = ibsegpar_fu-bukrs and
                 gjahr = ibsegpar_fu-gjahr and
                 augbl = ibsegpar_fu-belnr and  " Pradeep 20082008 Delete
                augbl <> ibsegpar_fu-belnr and " Pradeep 20082008 Insert
                 rebzg = space and
                 bschl = '25'.
          if sy-subrc = 0.
            loop at ibsegpar_fu_1.
              move ibsegpar_fu_1-rebzg to itabseg-rebzg.
              move ibsegpar_fu_1-rebzj to itabseg-rebzj.
            endloop.
            move ibsegpar_fu-belnr to itabseg-augbl.
            move itabseg-rebzg to itabseg-belnr.
            move itabseg-rebzj to itabseg-gjahr.
            itabseg-wrbtr = itabseg-wrbtr * -1.
            itabseg-pswbt = itabseg-pswbt * -1.
            select single budat into lsdat from
                 bkpf where bukrs = ibsegpar_fu-bukrs and
                 belnr = itabseg-rebzj and
                 gjahr = itabseg-rebzj.
            if sy-subrc = 0.
              move lsdat to itabseg-zfbdt.
            endif.
            append itabseg.
            read table itabseg with key
                 belnr = itabseg-rebzg
                 gjahr = itabseg-rebzj
                 bschl = '31' .
            if sy-subrc = 0.
             delete itabseg index sy-tabix. "Deleted by Pradeep 20082108
            endif.
          endif.
        endloop.
    Start insert by Pradeep 20082008
         loop at itabseg.
          if itabseg-belnr = itabseg-augbl.
            delete itabseg.
          elseif itabseg-belnr = ' '.
            delete itabseg.
          endif.
        endloop.
    End insert by Pradeep 20082008

    hi can anyone expalin me how to use parallel cursor for this code ... 
    loop at itabkpf.
          read table ibsegpar_fu with key
                     belnr = itabkpf-belnr
                     gjahr = itabkpf-gjahr
                     bschl = '25' .
    Start insert by Pradeep 20082008
          sort: itabkpf by belnr,
                itabsegpar by belnr.
    End insert by Pradeep 20082008
          if sy-subrc = 0. "Deleted by pradeep 20082008
            select bukrs belnr gjahr bschl koart lifnr wrbtr
                   wskto pswbt zfbdt augbl augdt sgtxt rebzg rebzj
                   into corresponding
                   fields of table ibsegpar_fu_1 from bseg
                   where bukrs = itabkpf-bukrs and
                   belnr = itabkpf-belnr and
                   gjahr = itabkpf-gjahr and
                   augbl <> itabkpf-belnr and
                   rebzg <> space and
                   bschl = '25'.
            loop at ibsegpar_fu_1.
    Start insert by Pradeep 20082008
              sort ibsegpar_fu_1 by belnr.
    End insert by Pradeep 20082008
              move-corresponding ibsegpar_fu_1 to itabseg.
              move ibsegpar_fu_1-belnr to itabseg-augbl.
              move ibsegpar_fu_1-rebzg to itabseg-belnr.
              move ibsegpar_fu_1-rebzj to itabseg-gjahr.
    *********to include code to pick the description for partical payment
              select single * from bseg where
                  bukrs = ibsegpar_fu_1-bukrs and
                  belnr = ibsegpar_fu_1-belnr and
                  gjahr = ibsegpar_fu_1-gjahr and
                  augbl <> ibsegpar_fu_1-belnr and
                  rebzg = space and
                  bschl <> '25'.
              move bseg-sgtxt to itabseg-sgtxt.
              clear bseg.
    *********end of code
              itabseg-wrbtr = itabseg-wrbtr * -1.
              itabseg-pswbt = itabseg-pswbt * -1.
              select single budat into lsdat from
                   bkpf where bukrs = ibsegpar_fu_1-bukrs and
                   belnr = ibsegpar_fu_1-rebzg and
                   gjahr = ibsegpar_fu_1-rebzj.
              if sy-subrc = 0.
                move lsdat to itabseg-zfbdt.
              endif.
              append itabseg.
            endloop.
          endif. "Deleted by Pradeep 20082008
        endloop.
        loop at ibsegpar_fu.
          sort ibsegpar_fu by belnr. " insert by pradeep
          move-corresponding ibsegpar_fu to itabseg.
          select bukrs belnr gjahr bschl koart lifnr wrbtr
                 rebzg rebzj sgtxt into corresponding
                 fields of table ibsegpar_fu_1 from bseg
                 where  bukrs = ibsegpar_fu-bukrs and
                 gjahr = ibsegpar_fu-gjahr and
                 augbl = ibsegpar_fu-belnr and  " Pradeep 20082008 Delete
                augbl <> ibsegpar_fu-belnr and " Pradeep 20082008 Insert
                 rebzg = space and
                 bschl = '25'.
          if sy-subrc = 0.
            loop at ibsegpar_fu_1.
              move ibsegpar_fu_1-rebzg to itabseg-rebzg.
              move ibsegpar_fu_1-rebzj to itabseg-rebzj.
            endloop.
            move ibsegpar_fu-belnr to itabseg-augbl.
            move itabseg-rebzg to itabseg-belnr.
            move itabseg-rebzj to itabseg-gjahr.
            itabseg-wrbtr = itabseg-wrbtr * -1.
            itabseg-pswbt = itabseg-pswbt * -1.
            select single budat into lsdat from
                 bkpf where bukrs = ibsegpar_fu-bukrs and
                 belnr = itabseg-rebzj and
                 gjahr = itabseg-rebzj.
            if sy-subrc = 0.
              move lsdat to itabseg-zfbdt.
            endif.
            append itabseg.
            read table itabseg with key
                 belnr = itabseg-rebzg
                 gjahr = itabseg-rebzj
                 bschl = '31' .
            if sy-subrc = 0.
             delete itabseg index sy-tabix. "Deleted by Pradeep 20082108
            endif.
          endif.
        endloop.
    Start insert by Pradeep 20082008
         loop at itabseg.
          if itabseg-belnr = itabseg-augbl.
            delete itabseg.
          elseif itabseg-belnr = ' '.
            delete itabseg.
          endif.
        endloop.
    End insert by Pradeep 20082008

  • How to use " toFront() " method in java application and in which package or

    How to use " toFront() " method in java application and in which package or class having this toFront() method.if anybody know pl. send example.

    The API documentation has a link at the top of every page that says "Index". If you follow that and look for toFront(), you will find it exists in java.awt.Window and javax.swing.JInternalFrame.
    To use it in a Java application, create an object x of either of those two classes and write "x.toFront();".

  • How to use XML / XPath in JAVA (in 1.4) which third part component to use?

    How to use XML / XPath in JAVA (in 1.4)
    I'm absolutely novice in XML
    but I need to query XML using XPath
    As I understand XPath become avalible only in Java 1.5
    But I use 1.4 (project requirement)
    Which third part component could you recomend?

    Can anyone help me with this XPath query
    I get result [title: null]
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.w3c.dom.*;
    import org.jaxen.*;
    import org.jaxen.dom.*;
    import org.jaxen.saxpath.*;
    import java.util.*;
    public class TestX {
         public void ggg() {
              try {
                   File f = new File("journal.xml");
                   DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                   org.w3c.dom.Document doc = docBuilder.parse(f);
                   XPath xpath = new DOMXPath( "/journal/article/title" );
                   List result = (List) xpath.evaluate(doc);
                   System.out.println(result.get(0));
              } catch (Exception e) {
                       e.printStackTrace();
         public static void main(String[] args) {
              TestX tx = new TestX();
              tx.ggg();
    }journal.xml
    <journal>
        <article id="article.1">
            <title>Art1</title>
            <author>
               <first>Bob</first>
               <last>McWhirter</last>
            </author>
            <text>
            </text>
        </article>
        <article id="article.2">
            <title>Art2</title>
            <author>
               <first>James</first>
               <last>Strachan</last>
            </author>
            <text>
            </text>
        </article>
    </journal>

  • How to use openjpa  + kodo in Java SE?

    Hi.
    We are developing J2EE application on Weblogic Server 9. For a part of application we should create unit tests that will be run in Java SE. How to use openjpa + kodo in Java SE?

    Hi,
    Try the EclipseLink JPA JEE5/JEE6 provider - it has been shipping as part of WebLogic Server since 10.3.1.0.
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    The following page has several SE, application-managed and container-managed EE example tutorials with source.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
    http://wiki.eclipse.org/EclipseLink/Examples/JPA
    The following forum will help you with any JPA specific issues.
    Forum: TopLink/JPA
    TopLink/JPA
    thank you
    /michael
    http://www.eclipselink.org

  • How to use host variable in Java?

    How do I use host variable in java? I am getting SQL code of -404 and description of SQL code is The UPDATE or INSERT statement specifies a String that is too long column-name SQLSTATE=22001. Below is my code:
    * i n s e r t M e s s a g e
    * insertMessage: This method will retrive detail message and other fields for
    * selected item from screen1.
    public final Collection insertMessage(String businessId,String messageNumber,String messageType,
    String messageTitle,String printStyle,String statusIndicator,
    String approverId,String lastUpdateId,String longMessage) {
    MessageTransport msi = new MessageTransport();
    PreparedStatement ps = null;
    Connection connection = null;
    MessageTransport msi1 = new MessageTransport();
    PreparedStatement ps1 = null;
    Connection connection1 = null;
    ArrayList list = new ArrayList();
    try {
    if (businessId != null) {
    businessId = businessId.trim();
    if (messageNumber != null) {
    messageNumber = messageNumber.trim();
    if (messageType != null) {
    messageType = messageType.trim();
    if (messageTitle != null) {
    messageTitle = messageTitle.trim();
    if (printStyle != null) {
    printStyle = printStyle.trim();
    if (statusIndicator != null) {
    statusIndicator = statusIndicator.trim();
    if (approverId != null) {
    approverId = approverId.trim();
    if (lastUpdateId != null) {
    lastUpdateId = lastUpdateId.trim();
    if (longMessage != null) {
    longMessage = longMessage.trim();
    int len = longMessage.length();
    if (len > 254) {
    int constant = 254;
    int k = len % constant; //k will hold value that has number of loops including initial insert.
    k = k - 1; //this is for total number of loop.
    int j = len / constant; //this will have remainder if any to insert rest of longmessage.
    System.out.println("Display remainder: " + k);
    System.out.println("Display divisible: " + j);
    System.out.println("Display Length of longMessage: " + len);
    StringBuffer sql = new StringBuffer();
    sql.append("INSERT INTO " + MESSAGE_TBL + " ( MT_BUS_ID,MT_MSG_NBR,MT_MSG_TYPE,MT_MSG_TITLE,MT_PRINT_STYLE,MT_APV_STATUS,MT_APV_ID,MT_APV_DT,MT_APV_TM,MT_LAST_UPDATE_ID,MT_LAST_UPDATE_DT,MT_LAST_UPDATE_TM,MT_MSG_TXT ) VALUES ");
    sql.append("(");
    sql.append("'");
    sql.append(businessId).append("'");
    sql.append(",").append(messageNumber);
    sql.append(",").append("'I'");
    sql.append(",").append("'").append(messageTitle).append("'");
    sql.append(",").append("'").append(printStyle).append("'");
    sql.append(",").append("'P'");
    sql.append(",").append("' '");
    sql.append(",").append("CURRENT DATE");
    sql.append(",").append("CURRENT TIME");
    sql.append(",").append("'").append(lastUpdateId).append("'");
    sql.append(",").append("CURRENT DATE");
    sql.append(",").append("CURRENT TIME");
    sql.append(",").append("'").append(longMessage).append("'");
    sql.append(")");
    System.out.println("Display SQL Statement: " + sql);
    connection = DriverManager.getConnection(DATABASE_URI, USER, PASS);
    ps = connection.prepareStatement(sql.toString());
    ps.executeUpdate();
    System.out.println("Refreshed Record: ");
    catch (SQLException sqle) {
    System.out.println("SQLException: "+ sqle + ". SQLSTATE=" + sqle.getSQLState()+" SQLCODE=" + sqle.getErrorCode());
    finally {
    if (ps != null) {
    try {
    ps.close();
    ps=null;
    catch (Exception e) {}
    if (ps1 != null) {
    try {
    ps1.close();
    ps1=null;
    catch (Exception e) {}
    if (connection != null) {
    try {
    connection.close();
    connection = null;
    catch (Exception e) {}
    if (connection1 != null) {
    try {
    connection1.close();
    connection1 = null;
    catch (Exception e) {}
    return list;
    if my longMessage is smaller like one line then everything works fine, but as soon as my longMessage if greater than 254 it starts giving me -404. How do I work around or Is there any way to use host variable in Java?
    All kind of help is appreciated. Any question then please email me at [email protected].
    Thank you.

    This is what you got to do to insert a larger value.
    //Assuming that message length is less than 254+ 254 characters.
    //If larger then run the update loop that many times.
    String longMessage = "Blah blah ... ";
    String firstPart = "";
    String secondPart = "";
    int messageLength = longMessage.length();
    if (messageLength > 254)
         try
              firstPart = longMessage.subString(0, 253);
              secondPart = longMessage.subString(254, message);
         catch (IndexOutOfBoundsException e)
    //In the first insert  set the first 254 characters
    ps.setString(1, firstPart);
    int result = ps.executeUpdate();
    if (result != 0)
           System.out.println("Insert  sucessful  ");
           if (messageLength > 254)
                //now update with the second part.
                static String UPDATE_SECOND_PART = UPDATE my.table SET LONG_COL = LONG_COL || ? WHERE KEY_COL = ?;
                ps2 = connection.getPreparedStatement(UPDATE_SECOND_PART);
                ps2.setString(1, secondPart);
                ps2.setString(2, businessId);  //assuming that businessId is the primary key.
                int result2 = ps2.executeUpdate();
                if (result2 != 0)
                      System.out.println("Update  sucessful  ");
                else
                     System.out.println("Update failed ");
    else
           System.out.println("Insert failed ");
    }Hope this helps.

Maybe you are looking for

  • My Notes were erased after this update

    My Apple notes where gone after 10.10.3 update Whats going on Apple people? dont you try your updates before releasing them? jeez man one after another, now I have to waste more time fixing up your stupidity than on my own work, we miss you Jobs, aft

  • I need help restoreing my ipod nano 3rd gen so its like new

    I need help restoreing my ipod nano 3rd gen so its like new

  • Trex 7.0 index issue

    Hi All, In our portal system which is on SAP Netweaver 7.0 ehp1 with Trex 7.0 version, there is a strange behaviour. The index corresponding to the repositories although they get created on reindexing every time allow for searching for the documents

  • My localised app says it runs in English on iTunes

    Hi Recently I released my first app. Initially things are going well, however I have one confusion: My app is localised and runs in 9 different languages, however when I check it out on the localised iTunes (say, the jp store for example) under the v

  • Dreamweaver MX 2004 won't import Jpg

    Im having a weird issue bringing jpeg files into dreamweaver mx 2004...it won't let me do it. Anyone seen this problem and how to fix it? thanks in advance