PLSQL Entity or Java Entity

I have requirement like this.
I have to update the table underlying my page and also should insert in Interface table.
Which will be best.PLSQL Entity or Java EO.

Have a Java EO to insert data into your table..
Before commit insert data into the intereface table by calling a pl/sql procedure..
refer http://prasanna-adf.blogspot.com/2008/11/callable-statement.html to invoke callable statement from OAF.
--Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Calling plsql block in java

    Hi
    Needs some help, urgently.
    i have to call/execute a plsql block in java program.
    block is similar to this
    declare
    CURSOR l_csr IS
    select empname, empid, empdate from emp
    order by empid;
    l_empid NUMBER;
    l_empdate DATE;
    l_empname varchar2(30);
    o_dateProfileId NUMBER;
    o_dayofweekprofileid NUMBER;
    begin
    open l_csr;
    loop
    FETCH l_csr INTO l_empid , l_empname , l_empdate;
    EXIT WHEN l_csr%NOTFOUND;
    DETERMINEEMPPROFILE(l_empdate,o_dateProfileId,o_dayofweekprofileid,l_empid ,FALSE);
    IF(o_dateProfileId IS NOT NULL) THEN
    SELECT totaljobs INTO l_max1 FROM dateprofile WHERE dateprofileid = o_dateprofileid;               
    ELSE
    SELECT totaljobs INTO l_max1 FROM dayofweekprofile WHERE dayofweekprofileid = o_dayofweekprofileid;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('SQLCODE = ' || SQLCODE);
    END;
    i need to call this in java program and take the results of l_max1.
    can someone provide an example of hot to do this or sample code
    appreciate any help

    I'm assuming this is for Oracle. Take a look at this article [url=http://www.enterprisedt.com/publications/oracle/result_set.html
    ]here for an example of how to use java to parse a result set from an Oracle procedure.

  • How to make plsql parser around java method

    can someone tell me how can i move Jdeveloper java method into oracle DB (how to make plsql parser around java method). Is this possible becouse in google i can not find any good example how to make this.

    Hi,
    I think you are talking about Java Stored Procedure (?)
    Look here, http://download.oracle.com/docs/cd/E11882_01/java.112/e10588/toc.htm
    Regards
    Peter

  • Howto map to an odata model function import returning an entity, not an entity set?

    Hi,
    how do I map to an odate model function import returning an entity (not an entity set) in a XML view? I tried property mapping {/method/property}, which does not make a network request and sets the value to null and I tried aggregation mapping {/method}, which makes a network request with $skip=0&$top=100&$inlinecount=allpages which is of course rejected by the odata source.
    Thanks,
    Wolfgang

    Hello Dr. Wolfgang,
    you can use
      var oParams = {};
      oParams.Field1 = 'ABC';
      oParams.Field2= 'XYZ';
      oParams.Field3= '123';
      oModel.callFunction('MyFuncImport', 'GET', oParams, null, function(oResponse){
            alert("Call to Func Imp successful");
        },function(){
            alert("Call to Func Imp failed");});
    also refer SAPUI5 SDK - Demo Kit
    Regards,
    Chandra

  • Business Components for Java entity beans of J2EE

    What is the future of Business Components for Java with the new standard entity beans of the sun Java 2 Entreprise Edition?
    Thanks.
    null

    The Standard Entity Beans are a component (JavaBean) that can be a small piece of the ultimate application needs.
    Oracle Business Component for Java is a complete framework that has numerous features that make developing COMPLETE applications easy.
    Please download the white paper on Business Components, try your hand at creating an application with Business Components (using the wizards) and you will see that Business Components for Java is much more than a simple (/complex) reusable component, it is a complete framework which maked developing N-tier applications almost trivial by allowing you to focus on writing your business logic while the framework takes care of all the application infrastructure and the necessary plumbing.
    Sincerely,
    John@Oracle JDeveloper Team http://technet.oracle.com
    null

  • How to create xml entity in java?????

    public Document createXml(String Error,String src,String trg)
                 DocumentBuilderFactory docBuilderFactory = null;
                DocumentBuilder docBuilder = null;
            //    src= src.replaceAll("&","I want this ");
               //  trg= trg.replaceAll("&","Yse !!!;");
                 try {
                      docBuilderFactory = DocumentBuilderFactory.newInstance();
                      docBuilder = docBuilderFactory.newDocumentBuilder();
                      xmlDoc = docBuilder.newDocument();
                     //create the root element
                     Element errorLog = xmlDoc.createElement("errorLog");
                     //all it to the xml tree
                       xmlDoc.appendChild(errorLog);
                      Entity e1=(Entity) xmlDoc.createEntityReference("amit");
                        xmlDoc.appendChild(e1);
                       Entity e2=(Entity) xmlDoc.createEntityReference("chch");
                       xmlDoc.appendChild(e2);
                          Element error = xmlDoc.createElement("error");
                             error.setAttribute("Type",Error);
                             errorLog.appendChild(error);
                             Element source = xmlDoc.createElement("source");
                             source.appendChild(xmlDoc.createTextNode(src));
                             error.appendChild(source);
                             Element target = xmlDoc.createElement("target");
                             target.appendChild(xmlDoc.createTextNode(trg));
                             error.appendChild(target);
                 } catch (Exception ex) {
                 return xmlDoc;
            }It seem to be failing in creating entities Help plzzzzzzzzzzzzzzzzzzzzzz

    I want out put like
    <?xml version="1.0"?>
    <!ENTITY amit ' xyz'>
    <errorLog>
    <error Type="Error">
    <source> this is </source>
    <target>Yes</target>
    </error></errorLog>
    bUT iT gives rest except Entity part
    Help!!!!!!!!!!!!

  • Trying to set a calculated attribute in an entity implementation java file

    Hi,, im working in Jdeveloper 9.0.3.2 in a web application and the problem is as follow:
    I have one table, This table has an attribute which value is calculated from another attribute in the same table. Take in account That it is not a trascient column, it is a real entity column in the entity object.
    First i tried this by using custom code in the validateEntity method but it was impossible because of the error: "JBO-28200: Validation threshold limit
    reached. Invalid Entities still in cache".
    next, i try the same by using custom code in the setter and getter methods by using the populateAttribute method and seems that transaction is successful but this result is only reflected in the entity cache so when im query directly the database this attribute is empty.
    I have not idea what to do.. im bored trying to get solution to this problem.
    Please help me!!!
    Thank u
    Orlando Acosta
    Infogroup Team
    Colombia South America

    Thank you very much for the answer.
    I tried to do what you suggested, but I get an error message when I tried to put session data into the user session object on my JSP page.
    Here is part of my codes in the JSP page.
    <%
    // Retrieve all request parameters using our routine to handle multipart encoding type
    RequestParameters params = HtmlServices.getRequestParameters(pageContext);
    String dsParam = params.getParameter("datasource");
    String formName = dsParam + "_form";
    String rowAction = "Current";
    String event = "Update";
    String userName = (String) session.getAttribute("userName");
    if (!(getDBTransaction().getSession().getUserData().containsKey("user")))
    getDBTransaction().getSession().getUserData().put("user",userName);
    %>
    And here is my error message.
    Error(16,16): method getDBTransaction not found in class _DecalDataEditComponent
    I got the other half working where I retrieved the session data in a setter method of an Entity Object Class as below.
    public void setDestroy(Date value)
    if (value!=null)
    setDestroyedBy((String)getDBTransaction().getSession().getUserData().get("user"));
    setAttributeInternal(DESTROY, value);
    Your help is very appreciated.

  • Accessing HttpSession in entity Impl.java

    Can someone please tell me if it is possible (and if so how) to set a HttpSession variable from within the entity's Impl class ?
    Currently I am overriding the doDML method to obtain the sequence number generated during the insert. I then want to use this later, hence need to store it somewhere
    Thanks,
    Brent

    What I was getting at above was something like this:
      protected void initializeBindingsForPage(DataActionContext ctx)
        // TODO:  Override this view.fwkext.BaseDataForwardAction method
        // super.initializeModelForPage(ctx);
        HttpServletRequest request = ctx.getHttpServletRequest();
        String strRemoteUser = request.getRemoteUser();
        System.out.println("remoteUser=" + strRemoteUser );
        setBindingValue("CreatedByUsername"
           , strRemoteUser
           , ctx );
      }In this case, the application was written to use FORM-based authentication, and the user then gets "stuffed" into an audit field exposed on the page's bindings. From there, you'd have it on the backend when the DML was eventually called.
    Am I missing something?

  • Uses a non-entity as target entity

    Hi everyone,
    I need your help because I am working on a project j2ee6
    I am using jpa (eclipseLink)
    when I created entities without relation, all worked perfectly
    but now that I am trying to set up relation @oneTomany @ManyToOne
    I got this error all the time
    Exception Description: [class com.Domain.User] uses
    [ERROR] a non-entity [class com.Domain.Groups] as target entity in the
    [ERROR] relationship attribute [field groupe].
    here is my user entity :_
    @Entity
    @NamedQueries({
         @NamedQuery(name = "findAllUsers", query="select u from User u"),
         @NamedQuery(name = "findWithLogParam", query="select u from User u where u.Email = :fmail and u.Password = FUNC('sha1', :fpass)")
    public class User implements Serializable{
         private static final long serialVersionUID = 3175161374832714727L;
         @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
         private Long UserId;
         @Column(nullable = false)
         private String Title = "Mr";
         @Column(nullable = false)
         private String Login;
         @Column(nullable = false)
         private String Password;
         @Column(nullable = false)
         private String Firstname;
         @Column(nullable = false)
         private String Lastname;
         @Column(nullable = false)
         private String Email;
         private String Telephone;
         private String Mobile;
         @Temporal(TemporalType.DATE)
         private Date Date_of_birth;
         private String Postcode;
         private String Address;
         private String City;
         private String County;
         private String Region;
         private String Country;
         private String AccountEnabled="On";
         @ManyToOne(optional=false)
    @JoinColumn(name="GROUPID", referencedColumnName="GROUPID")
         private Groups groupe;
         private String Token;
    Here is the entity Groups*
    @Entity
    public class Groups implements Serializable{
         private static final long serialVersionUID = 7092895671981671161L;
         @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
         private Long GroupId;
         @Column(nullable = false)
         private String GroupName;      
         @OneToMany(mappedBy="groupe", targetEntity=User.class, fetch=FetchType.EAGER)
         private List<User> UserList = new ArrayList<User>();
    Here is my persistence.xml*
    <?xml version="1.0" encoding="windows-1252" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
                   version="2.0">
         <persistence-unit name="testPU" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>     
              <jta-data-source>jdbc/UnmodDB</jta-data-source>     
              <class>com.unmod.Domain.User</class>
              <class>com.unmod.Domain.Groups</class>
    ........ other classes ......
              <exclude-unlisted-classes>false</exclude-unlisted-classes>
              <properties>
                   <property name="eclipselink.target-database" value="MySQL"/>
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
                   <property name="eclipselink.ddl-generation.output-mode" value="database" />
              <property name="eclipselink.create-ddl-jdbc-file-name" value="create.sql"/>
              </properties>
         </persistence-unit>
    </persistence>
    It works (compliation works) when I add @Basic however only the user table is created
    Thanks

    Yes it's strange because
    when I comment the oneToMany/ManyToOne parts
    I see hibernate is called
    Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    INFO: Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
    INFO: Using provided datasource
    INFO: RDBMS: MySQL, version: 5.5.20
    INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.18 ( Revision: [email protected] )
    INFO: Using dialect: org.hibernate.dialect.MySQLDialect
    INFO: Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
    INFO: instantiating TransactionManagerLookup: org.hibernate.transaction.SunONETransactionManagerLookup
    INFO: instantiated TransactionManagerLookup
    INFO: Automatic flush during beforeCompletion(): disabled
    INFO: Automatic session close at end of transaction: disabled
    INFO: JDBC batch size: 15
    INFO: JDBC batch updates for versioned data: disabled
    INFO: Scrollable result sets: enabled
    but when I added the OneToMany/ManyToOne
    I got
    [INFO] Command deploy failed.
    [ERROR] remote failure: Unknown plain text format. A properly formatted response from a PlainTextActionReporter
    [ERROR] always starts with one of these 2 strings: PlainTextActionReporterSUCCESS or PlainTextActionReporterFAILURE. The response we received from the server was not understood: Signature-Version: 1.0
    [ERROR] message: Error occurred during deployment: Exception while preparing t
    [ERROR] he app : Exception [EclipseLink-28018] (Eclipse Persistence Services
    [ERROR] - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityMa
    [ERROR] nagerSetupException
    [ERROR] Exception Description: Predeployment of P
    [ERROR] ersistenceUnit [chapter02PU] failed.
    [ERROR] Internal Exception: Exce
    [ERROR] ption [EclipseLink-7250] (Eclipse Persistence Services - 2.3.0.v20110
    [ERROR] 604-r9504): org.eclipse.persistence.exceptions.ValidationException%%%
    [ERROR] EOL%%%Exception Description: [class com.unmod.Domain.User] uses a non
    [ERROR] -entity [class com.unmod.Domain.Groups] as target entity in the relat
    [ERROR] ionship attribute [field groupe].. Please see server.log for more det
    [ERROR] ails.
    [ERROR] Exception while invoking class org.glassfish.persistenc
    [ERROR] e.jpa.JPADeployer prepare method : javax.persistence.PersistenceExcep
    [ERROR] tion: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2
    [ERROR] .3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManag
    [ERROR] erSetupException
    [ERROR] Exception Description: Predeployment of Pers
    [ERROR] istenceUnit [chapter02PU] failed.
    [ERROR] Internal Exception: Excepti
    [ERROR] on [EclipseLink-7250] (Eclipse Persistence Services - 2.3.0.v20110604
    [ERROR] -r9504): org.eclipse.persistence.exceptions.ValidationException%%%EOL
    [ERROR] %%%Exception Description: [class com.unmod.Domain.User] uses a non-en
    [ERROR] tity [class com.unmod.Domain.Groups] as target entity in the relation
    [ERROR] ship attribute [field groupe].
    [ERROR] Exception [EclipseLink-28018]
    [ERROR] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.p
    [ERROR] ersistence.exceptions.EntityManagerSetupException
    [ERROR] Exception Descripti
    [ERROR] on: Predeployment of PersistenceUnit [chapter02PU] failed.
    [ERROR] Internal E
    [ERROR] xception: Exception [EclipseLink-7250] (Eclipse Persistence Services
    [ERROR] - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.Validati
    [ERROR] onException
    [ERROR] Exception Description: [class com.unmod.Domain.User] uses
    [ERROR] a non-entity [class com.unmod.Domain.Groups] as target entity in the
    [ERROR] relationship attribute [field groupe].
    it's like eclipseLink wanted to bug me over Hibernate.

  • Cal plsql pkg from Java concurrent program

    Hi,
    I try to execute one plsql pkg inside a java concurrent pgm.plsql code executed from view output i got the out put.Bt my status Shows ERROR.
    this is my code
    try{
    System.out.println("transation type inside try block "+deptno);
    CallableStatement cs=con.prepareCall("{call XX_ANE_DEPT2_PKG.XX_ANE_DEPT2_PRC(?,?,?)}");
    cs.setString(1,null);
    cs.setString(2,null);
    cs.setString(3,deptno);
    cs.execute();
    con.commit();
    cs.close();
    //LF.writeln("Generating Programs for Application : " + transactionType, LogFile.STATEMENT);
    //OF.writeln( " Available Concurrent Programs for Application " +transactionType );
    catch(SQLException ex){
    lRC.setCompletion(ReqCompletion.ERROR, ex.toString());
    finally
    pCpContext.releaseJDBCConnection();
    I dont knw why the status is error any one pls help.If it is wrong method any one pls give a sample pgm to cal a PKG in concurrent pgm.
    pls help
    Edited by: aneeshmathew on Dec 28, 2010 4:49 AM
    Edited by: aneeshmathew on Dec 28, 2010 4:49 AM

    Are you able run this concurrent program from form application.? if it erroring out there what error you are getting.
    Thanks

  • Plsql exceptions from Java?

    If I have plsql like this:
    blue exception;
    red exception;
    Is there some way that I can tell from
    which java which of those exceptions has
    been raised? (I am aware of raise_application_error).

    http://examples.oreilly.com/9780596514464/Chapters_27and28_OPLSQL5e.pdf
    Sybrand Bakker
    Senior Oracle DBA

  • After creation related entity method, child entity's Parent GUID not popu..

    Hi All,
    I am creating related entity with method create_related_entity of BOL Entity,
    then doing some modifications to this created entity fields with SET_PROPERTY method,
    then with BOL_CORE->MODIFY is functioning then getting Transaction context of BOL_CORE and doing SAVE & COMMIT,
    but due to after created related entity, no Paret GUID is present for this entity & TERR GUID of entity too, so its not saving....
    what we can do....?
                                            PARTNER_GUID                                             00000000000000000000000000000000
                                            TERR_GUID                                             00000000000000000000000000000000
                                            TERR_ID                                             500050
                                            TERR_DESC                                       
                                            VALID_FROM                                             20110817
                                            VALID_TO                                             99991231
                                            BP_NODE_GUID                                             00000000000000000000000000000000
                                            DIRECT                                       
                                            OVERRIDDEN                                       
    here Partner GUID & TERR GUID are not getting generating, after created related entities,
    when we can do, so that this child get saved under proper parent...?
    Thanking you.
    Regards,
    VIJHYD
    Edited by: vjmhyd on Aug 17, 2011 3:38 PM
    Edited by: vjmhyd on Aug 17, 2011 3:39 PM
    Edited by: vjmhyd on Aug 17, 2011 3:45 PM

    Self

  • Calling a PLSQL package from java

    Hi All
    I have a problem calling a package from java. I have to pass a Date to the package which is a String in java.
    How can I typecast it to the PLSQL Date from a java String.
    Here is my below code for reference. The below code does not works because of typecasting problem.I tried to_date() also in java, but it is not working.
    cstmt=connDbConn.prepareCall("{call pkage.PACK1(?)}"); cstmt.setString(1,"01-JAN-2009");

    keyanwb wrote:
    How can I typecast it to the PLSQL Date from a java String.That datatype in Oracle contains a date and time component.
    Thus you should consider exactly what storing the date only component means in terms of the timezone that the Oracle server is using.

  • Intersection/Associative Entity and Normal Entity in ERD

    Hi,
    Could anybody please tell me how I should differentiate between an intersection/associative entity (resulting from many-many relationship) and the normal entity in the E-R Diagrammer of Designer 6i???
    Regards,
    Moiz

    What is your defintion of a normal entity.
    Are you looking for a naming standard or modeling standard?
    Are you attempting to transform a many-to-many? I think designer will generate the appropriate intersection but you may need to adjust the settings. Use surrogate keys and both for constraint implementation.

  • Error while running entity - help needed

    Hi everybody,
    Following is the error i get when i run the following comand,
    It prepares the std_ejb_jar file and when executing the ejbc command following error ocurs :
    D:\bea\wlserver6.0\samples\ejb\com\entity\cabin>java -classpath d:\bea\wlserver6.0/lib/weblogic_sp.jar;d:\bea\wlserver6.0/lib/weblogic.jar weblogic.ejbc -verbose -compiler javac build\std_ejb_cabin.jar \ejb_cabin.jar
    ERROR: Error from ejbc: [9.7.12] In EJB cabinmethod, the findByPrimaryKey method must return the Entity bean's remote interface type, and it's parameter must be the primary key type or java.lang.Object: findByPrimaryKey(ejb.com.entity.cabin.CabinPK) ERROR: ejbc found errors Process Exit...
    I have a table called cabin_table with id has not null.
    Thanx in Advance

    Thanks Buddy,
    I think that was the correct one, but as i was using the example of ejb1.1 compatible, this is futher giving me a problem, Says U need to make the methods in the bean as abstract, i think this is as per the ejb2.0 specs right?.
    I would try for that ad come back to u
    Thanks
    Amit

Maybe you are looking for

  • Add a new POP email acct to iPad

    I am trying to add a new POP account to y husband's iPad 3rd generation, IOS 6. It creates as an IMAP account, which AT&T / sbcglobal.net does not support. I thought there used to be a toggle or selection for POP or IMAP when I have done this in the

  • PIA service does not start

    Hi, my webserver is Weblogic (9.2, Tools 8.49 , HRMS90). PIa service does not start automaticaly when I start/boot the server. I should run startPIA.cmd. And then I can connect in 4/3. Do you have any idea for that ? In windows Evenetlog it says Even

  • IBAN Number for Wire payment processing

    Hi All, When we entered IBAN number on Vendor master and click generate button, Bank key, bank Account details and Swift Code nomen clature like "XXXXFRXX" are automatically updated on vendor master. We believe Swift Code "XXXXFRXX" is just a nomen c

  • Upgrading with Student and Teacher Discount

    I have Adobe Creative Suite 5 Web Premium Student and Teacher Edition installed on my computer, and would like to upgrade to a package with Adobe InDesign (CS5, CS5.5, CS6). What is the least expensive option?  I am not interested in the Cloud softwa

  • Premiere Pro CS5 - Mac Chroma Key

    Is the chroma key feature available in PP CS5 for the mac yet? I can't seem to find any confirmation of this.