Same CMR and CMP field in relationship bean

Hi,
     I'm trying to deploy a 1:N realtion, it all works well
but the many part of relation when ever i try to update i get an
error stating. A CMP cum CMR field should not have a setter method
and it should be read only. Is there i'm doign anything wrong?
operation:
Bean A-- Bean B 1-N
update foreign key of Bean B , throws exception stating there should not
be setter.
How to handle a CMP field as CMR.??
Help appreciated,
Thanks,
Venki

Table A
prim key
table B
prim key
Foreign Key
A--- B is 1-- N
when i try to create Table B using
setForeignKey()method i get the following error.
Error :
javax.ejb.EJBException: When a cmp-field and a cmr-field (relationship) are mapp
ed to the same column, the setXXX method for the cmp-field may not be called.
T he cmp-field is read-only.
"Venki" <[email protected]> wrote:
>
Deepak
What if i use the same field for CMP and CMR?
projectId CMP as well as CMR.
I cannot have two methods right?
Venki
Deepak Vohra <[email protected]> wrote:
In the bean class should be a get<Cmp-Field>() method and get<Cmr-Fields>()
method.
public abstract <Cmp-Field-Type> get<Cmp-Field>(){}
public abstract java.util.Collection get<Cmr-Fields>(){}
Venki Seshaadri wrote:
Hi,
I'm trying to deploy a 1:N realtion, it all works well
but the many part of relation when ever i try to update i get an
error stating. A CMP cum CMR field should not have a setter method
and it should be read only. Is there i'm doign anything wrong?
operation:
Bean A-- Bean B 1-N
update foreign key of Bean B , throws exception stating there shouldnot
be setter.
How to handle a CMP field as CMR.??
Help appreciated,
Thanks,
Venki

Similar Messages

  • A cmr-field and a cmp-field on the bean are using the same name. The names

    Hi:
    I am using weblogic 8.1 and MyEclipse 5.1.1. I am deploying my ear application through MyEclipse 5.1.1 as an ear file.
    When I ran the following EJB QL:
    SELECT OBJECT(p) FROM Product p.category = ?1
    I get the following error:
    n relation Category-Product, a cmr-field and a cmp-field on the bean are using the same name. The names of cmr and cmp fields must be unique.
    It is basically complaining that I have a field
    <cmr-field>
                             <cmr-field-name>category</cmr-field-name>
                        </cmr-field>
    in my ejb-jar.xml and also the same category in the
    <cmp-field><field-name>category</field-name></cmp-field>
    field. The problem is that if I changed the value of the cmr-field, I have to add a get and set in my productLocal.java and when you do that you have to do the same in the ejb-jar.xml.
    Here is my ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>CategoryEJB</ejb-name>
    <local-home>com.CategoryHomeLocal</local-home>
    <local>com.CategoryLocal</local>
    <ejb-class>com.CategoryBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Category</abstract-schema-name>
         <cmp-field><field-name>categoryId</field-name></cmp-field>
    <cmp-field><field-name>categoryName</field-name></cmp-field>
    <cmp-field><field-name>picture</field-name></cmp-field>
    <cmp-field><field-name>pictureWidth</field-name></cmp-field>
    <cmp-field><field-name>pictureHeight</field-name></cmp-field>
    <cmp-field><field-name>labelOn</field-name></cmp-field>
         <cmp-field><field-name>labelOff</field-name></cmp-field>
         <cmp-field><field-name>button</field-name></cmp-field>
    <primkey-field>categoryId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
              <query>
                   <query-method>
                        <method-name>findCategory</method-name>
                        <method-params></method-params>
                   </query-method>
                   <ejb-ql>
                        SELECT OBJECT(c) FROM Category c
                   </ejb-ql>
              </query>
         </entity>
         <entity>
    <ejb-name>ProductEJB</ejb-name>
    <local-home>com.ProductHomeLocal</local-home>
    <local>com.ProductLocal</local>
    <ejb-class>com.ProductBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Product</abstract-schema-name>
         <cmp-field><field-name>productId</field-name></cmp-field>
    <cmp-field><field-name>brandName</field-name></cmp-field>
    <cmp-field><field-name>productDescription</field-name></cmp-field>
    <cmp-field><field-name>purchasePrice</field-name></cmp-field>
    <cmp-field><field-name>category</field-name></cmp-field>
    <primkey-field>productId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
              <query>
                   <query-method>
                        <method-name>findProduct</method-name>
                        <method-params>
                        <method-param>com.CategoryLocal</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        SELECT OBJECT(p) FROM Product p.category = ?1
                   </ejb-ql>
              </query>
         </entity>
    </enterprise-beans>
    <relationships>
                   <ejb-relation>
                   <ejb-relation-name>Category-Product</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>
                             Category-has-many-Product-numbers
                        </ejb-relationship-role-name>
                        <multiplicity>one</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CategoryEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>productNumbers</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>
                             Product-belongs-to-Category
                        </ejb-relationship-role-name>
                        <multiplicity>many</multiplicity>
                        <cascade-delete/>
                        <relationship-role-source>
                             <ejb-name>ProductEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>category</cmr-field-name>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
    </relationships>
    <assembly-descriptor>
    <security-role>
    <role-name>Employees</role-name>
    </security-role>
    <method-permission>
    <role-name>Employees</role-name>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    <container-transaction>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>ProductEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>     
    Here is my weblogic-cmp-rdbms-jar.xml:
    <!DOCTYPE weblogic-rdbms-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
         <ejb-name>CategoryEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
         <table-map>
              <table-name>category</table-name>
              <field-map>
              <cmp-field>categoryId</cmp-field>
              <dbms-column>categoryID</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>categoryName</cmp-field>
              <dbms-column>categoryName</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>picture</cmp-field>
              <dbms-column>Picture</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>pictureWidth</cmp-field>
              <dbms-column>PictureWidth</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>pictureHeight</cmp-field>
              <dbms-column>PictureHeight</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>labelOn</cmp-field>
              <dbms-column>LabelOn</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>labelOff</cmp-field>
              <dbms-column>LabelOff</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>button</cmp-field>
              <dbms-column>Button</dbms-column>
              </field-map>
    </table-map>
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>
    </automatic-key-generation>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-bean>
         <ejb-name>ProductEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
         <table-map>
              <table-name>PRODUCT</table-name>
              <field-map>
              <cmp-field>productId</cmp-field>
              <dbms-column>productId</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>brandName</cmp-field>
              <dbms-column>brandName</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>productDescription</cmp-field>
              <dbms-column>productDescription</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>purchasePrice</cmp-field>
              <dbms-column>purchasePrice</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>category</cmp-field>
              <dbms-column>categoryId</dbms-column>
              </field-map>
    </table-map>
         <!-- Automatically generate the value of ID in the database on inserts using sequence table -->
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>
    </automatic-key-generation>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-relation>
         <relation-name>Category-Product</relation-name>
    <weblogic-relationship-role>
    <relationship-role-name>Product-belongs-to-Category</relationship-role-name>
              <relationship-role-map>
    <column-map>
    <foreign-key-column>categoryId</foreign-key-column>
    <key-column>categoryID</key-column>
    </column-map>
              </relationship-role-map>
    </weblogic-relationship-role>
    </weblogic-rdbms-relation>
    </weblogic-rdbms-jar>
    Here is my productLocal.java:
    package com;
    import javax.ejb.CreateException;
    import javax.naming.NamingException;
    import java.util.Date;
    import java.util.Vector;
    import java.util.Collection;
    public interface ProductLocal extends javax.ejb.EJBLocalObject
         public Integer getProductId();
         public void setProductId(Integer productId);
         public String getBrandName();
         public void setBrandName(String brandName);
         public String getProductDescription();
         public void setProductDescription(String productDescription);
         public Double getPurchasePrice();
         public void setPurchasePrice(Double purchasePrice);
    public CategoryLocal getCategory();
         public void setCategory(CategoryLocal category);
    Here is my ProductBean.java:
    package com;
    import javax.naming.InitialContext;
    import javax.ejb.EntityContext;
    import javax.ejb.CreateException;
    import javax.naming.NamingException;
    import java.util.Date;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.Vector;
    import java.lang.Integer;
    public abstract class ProductBean implements javax.ejb.EntityBean
         public Integer ejbCreate(Integer id)
              this.setProductId(id);
              return null;
         public void ejbPostCreate(Integer id)
         //public abstract Integer getCategoryId();
    //     public abstract void setCategoryId(Integer categoryId);
         public abstract CategoryLocal getCategory();
         public abstract void setCategory(CategoryLocal category);
         public abstract Integer getProductId();
         public abstract void setProductId(Integer productId);
         public abstract String getBrandName();
         public abstract void setBrandName(String brandName);
         public abstract String getProductDescription();
         public abstract void setProductDescription(String productDescription);
         public abstract Double getPurchasePrice();
         public abstract void setPurchasePrice(Double purchasePrice);
         public void setEntityContext(EntityContext ec)
              System.out.println("ProductBean setEntityContext");
         public void unsetEntityContext()
              System.out.println("ProductBean unsetEntityContext");
         public void ejbLoad()
              System.out.println("ProductBean ejbLoad");
         public void ejbStore()
              System.out.println("ProductBean ejbStore");
         public void ejbActivate()
              System.out.println("ProductBean ejbActivate");
         public void ejbPassivate()
              System.out.println("ProductBean ejbPassivate");
         public void ejbRemove()
              System.out.println("ProductBean ejbRemove");
    What do I needed to do to fix this problem.
    Any hint or help would be greatly appreciated!!!
    Yours,
    Frustrated

    cmr field which is "category" in ur mapping , u can't use as cmp field in abstract schema mapping. just remove category from cmp field . and every thing is fine

  • Issue in mapping the same source and target fields

    Hi All,
    I am working on PI 7.0 and currently I am connecting to PI 7.0 via citrix desktop . Problem here is : in the mapping , direct mapping option that is available to map the same source and target fields is disabled . I do know that this is due to some java version issue .
    What I want to know is there any possibilty of solving this issue without installing an updated java version ?
    Regards
    Vinay P.

    I've faced the same for many times and all of that were due to Java version.
    1st of all, you have to check the authorizations you have. If you have enough (DEVELOPER_J2EE, CONTENT_ORGANIZER_J2EE, and so), and - obvious but very often forgotten - you have to assure you're trying to change it in the message mapping change mode On.
    Then, last shot should be downgrade your Java version.
    The 1.4.2 JRE version allow you to use not only the Mapp the Identical field but also Dependencies, Clear Mapping and some other tools/buttons. As mentioned above, if there's a fix in the new Java releases, I do not know (hope so) and would appreciate if you could let us know.
    Tks.

  • Did elationship fields in entity bean with CMP same as foreign key in table

    did elationship fields in entity bean with CMP same as foreign key in table database.so we don't have to make some foreign key column in table database.
    did Container handle that both.
    I need some answer
    thank's

    Suppose you have Group and user entity. Relation is 1-m. One group many users. When you create user, you dont need to send group id, All you need is create user and add it in collection (cmr-field) in group(user belongs to). Container will add its group id in user entity as well as in db.

  • Bean property and public field found with the same name: getid

    Hi all,
    I have a ejb jar file contains some local entity beans and one session bean
    , the session bean has some functions suck as findXXXByQuery() , InsertXXX()
    , and I have created some model class for the entity bean , and use it as
    the parameter or return type of the session bean , then I want to transfer
    the session bean as a webservice , using ant automaticly . All this function
    successfully in weblogic 6.1 , but when I want to run ant command in
    weblogic 7.0 , an error occured :
    [servicegen] weblogic.xml.schema.binding.BindingException: Error: bean
    property
    and public field found with the same name: getid
    Yes , I have a getid field in table , a getid in entity bean , and a getid
    property in model class , but what different does it make ? Would you mind
    to test my jar file ? I send all files as attachments .
    Any advice will be appreciate .
    lcl
    [build.xml]
    [work.jar]

    In article <[email protected]>, lcl <[email protected]> wrote:
    -=-=-=-=-=-
    Hi all,
    I have a ejb jar file contains some local entity beans and one session bean
    , the session bean has some functions suck as findXXXByQuery() , InsertXXX()
    , and I have created some model class for the entity bean , and use it as
    the parameter or return type of the session bean , then I want to transfer
    the session bean as a webservice , using ant automaticly . All this function
    successfully in weblogic 6.1 , but when I want to run ant command in
    weblogic 7.0 , an error occured :
    [servicegen] weblogic.xml.schema.binding.BindingException: Error: bean
    property
    and public field found with the same name: getid
    Yes , I have a getid field in table , a getid in entity bean , and a getid
    property in model class , but what different does it make ? Would you mind
    to test my jar file ? I send all files as attachments .
    Any advice will be appreciate .
    lcl
    -=-=-=-=-=-For better or worse the JAX-RPC spec requires this behavior. From
    section 5.4.1:
    "There is no standard mapping for the case when a JavaBean property
    has the same name as a public field. A Java to XML mapping
    implementation is required to flag this case as an error."
    Since you are not the first person to run into this restriction I'm
    beginning to think we need an option to bypass it.
    --Scott

  • How to add new CMP field to CMP bean

    I am back for your amusement. I have seen similar things to this in other postings, but I have not been able to find one that, when action is taken, solves my problem.
    I am using Sun Java Studio Enterprise 7 2004Q4
    Our database changed by adding one new field. I need to update the bean for that table. Since the bean was created from a schema, I thought I need to update the schema first. Having found no way to do that yet, I recreated the schema under a different name, deleted the old one and renamed the new one to the old name. Follow that? :|
    Ok. So now I have a new schema with the old name. I still have the old one in CVS so I can get it back (see I am learning someting).
    I then went to the bean and added a new CMP field. I updated all my code to use the new field accessors. Changed the create method to have one more field and use the accessor.
    Then in the module where the bean is being used I mapped the new field to the field in the database. The CMP is in a relationship with two other beans, but this field is not used (not yet anyway).
    I then compiled and depoyed. Everything went ok. "I am really getting the hang of this EJB stuff", I said to my self. Then I tried to run it.... I should have saved the comment for another time... :(
    I got this message and exception :
    "Validation error in class com.PersonCMPBean685435892_JDOState: com.sun.jdo.api.persistence.model.util.ModelValidationException: Warning: Cannot find the column person.p_umd_id for mapping the field pUmdId in the class com.PersonCMPBean685435892_JDOState.
    Verify that the schema file exists and that its contents are correct."
    com.sun.jdo.api.persistence.support.JDOUserException: The mapping for class com.PersonCMPBean685435892_JDOState is invalid. Compile the class in the IDE, correct any errors, and verify that all required files are packaged for execution.
    The schema exists. The field is in the new schema. Hmmm. I screwed up. Stamp it on my forehead with the others from working with EJB.... :)
    So what did I do wrong? How is this supposed to be done. Is there an easier way to update the schema?
    Any help will be greatly appreciated. Thank you.

    Ok. I found something that works, albeit I don't think it is the recommended way. But since I can't find a recommended way, I will settle for working. This was a suggestion from someone else who had this problem ( http://swforum.sun.com/jive/thread.jspa?forumID=122&threadID=23428 ). But I have broken it down into steps and refined it a bit.
    1. Create a new schema under a different name.
    2. Go to the module that has a bean that is using the old schema.
    3. Find the reference for the bean under the module and look at the properties for the bean.
    4. In the properties in the Sun Java System As section there is a property called Mapped Schema. Change it to the new schema.
    5. deploy
    There's more...
    If you need to have the same name for the schema, like I did because I keep it in CVS, do this:
    6. Shutdown the IDE
    7. Go to the directory where the schema is and rename it to whatever you need (whatever you had originally).
    8. restart the IDE
    9. repeat steps 2-4
    10. restart the IDE again before you deploy!
    I know this is insane. But it is all I could figure out so far. If anybody has something else that is better, please, please, please let me know!

  • All cmp-fields that double as cmr-fields must have an object type??

    Greetings,
    I'm deploying an application in weblogic 8.1sp2 that worked fine in
    jboss 3.2. The error is:
    Exception:weblogic.management.ApplicationException: prepare failed for
    ServiceEJB.jar Module: ServiceEJB.jar Error: Exception preparing module:
    EJBModule(ServiceEJB.jar,status=NEW) Unable to deploy EJB:
    ServiceEJB.jar from ServiceEJB.jar: [EJB:011017]Error while reading
    'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was: In relationship
    'primitive_TO_primitive_param', role
    'primitive_param_BELONGS_TO_primitive', a cmp-field used to implement
    this relationship has a primitive type. All cmp-fields that double as
    cmr-fields must have an object type. . at
    weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:255) at
    Does it means that I should cmp field from "int" type to "Integer"
    object??? If true, I really don't know why the requirement since in
    jboss worked just fine. But do you confirm it?
    regards,
    Pedro Salazar

    I believe there is a requirement that any field used as a primary or
    foreign key must be an object and implement hashCode/equals.
    I'd post in weblogic.developer.interest.ejb.cmp if you want more
    information.
    -- Rob
    Pedro Salazar wrote:
    Greetings,
    I'm deploying an application in weblogic 8.1sp2 that worked fine in
    jboss 3.2. The error is:
    Exception:weblogic.management.ApplicationException: prepare failed for
    ServiceEJB.jar Module: ServiceEJB.jar Error: Exception preparing module:
    EJBModule(ServiceEJB.jar,status=NEW) Unable to deploy EJB:
    ServiceEJB.jar from ServiceEJB.jar: [EJB:011017]Error while reading
    'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was: In relationship
    'primitive_TO_primitive_param', role
    'primitive_param_BELONGS_TO_primitive', a cmp-field used to implement
    this relationship has a primitive type. All cmp-fields that double as
    cmr-fields must have an object type. . at
    weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:255) at
    Does it means that I should cmp field from "int" type to "Integer"
    object??? If true, I really don't know why the requirement since in
    jboss worked just fine. But do you confirm it?
    regards,
    Pedro Salazar

  • CMP and Serializable fields

    Hello,
    I would like to declare a field in an CMP Entity Bean to hold Serializable objects.
    It seems to work fine for primitive types and arrays of them but I get an exception as soon as I try to set the field via the bean remote interface with an instance of a user created class implementing Serializable :
    com.evermind.server.rmi.OrionRemoteException: Method invocation failed (Invalid return command: 6)
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
              RMIConnection.java:1499
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
              RMIConnection.java:1452
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RemoteInvocationHandler.java:55
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RecoverableRemoteInvocationHandler.java:22
         void __Proxy1.setBehaviour(java.io.Serializable)
         void cern.laser.business.test.ConsoleConfigurationEntityEJBClient.main(java.lang.String[])
              ConsoleConfigurationEntityEJBClient.java:27
    The class looks like :
    public class MyClass implements java.io.Serializable
    private String s;
    public MyClass ()
    s = new String("ciao ciao");
    The corresponding database column is defined as BLOB.
    Thanks for your help,
    Francesco.

    Can any body tell me the relation between cmp and cmr
    fields in CMP beans
    Thanks in Advance
    SudhakarWe could say:
    If an Entity EJB is a record of a database table, a CMP is like a simple table column and a CMR represents a table column refering to a Foreign Key.
    Fil

  • Is it possible to map the cmp fields of the entity bean with out dictionary

    Dear sirs,
    I have created the EJB project module and WEB Module. Now i have to map the CMP fields of the entity bean to the underlying table. Is it possible to map the cmp fields of the entity bean with out java dictionary? If yes how can we do that.
    I have got some error while mapping an EJB's CMP fields to the table through dictionary. I was actually intended to map 79 fields but it gives an error that more than 64 fields are not allowed while building the dictionary.
    1. Can you tell me what could be the possible reason?
    2. Is it possible to map the cmp fields of the entity bean with out java dictionary? If yes how can we do that.
    Kindly helo me,
    Sudheesh K S

    Hi,
    Sudheesh please check up if the below link helps,there are other ways of writing the persistent.xml for container managed entity bean.
    http://help.sap.com/saphelp_nw04s/helpdata/en/9b/f695f0c84acf46a4e0b31f69d8a9b7/frameset.htm, probably in the studio you cannot browse through tables not in  the java dictionary,but manually editing it may still solve the problem.
    Also here is another link that specifies the databases supported by J2EE Engine.
    http://help.sap.com/saphelp_nw04s/helpdata/en/66/a5283eeb47b40be10000000a114084/frameset.htm
    The below link shows how to specify the database vendor and datasource
    http://help.sap.com/saphelp_nw04s/helpdata/en/e1/67fc3ee241ba28e10000000a114084/frameset.htm
    Hope you are able to solve the problem.
    Do let us know if you come up with the solution.
    Regards,
    Harish
    Message was edited by: HARISH SUBRAMANIAN

  • Besides a PDF Portfolio is there another way to add Pages to a PDF that have fields of the same name and still have them Unique?

    Besides the PDF portfolio is there another way to add pages to a PDF file that have the same name in form fields and still keep the different pages unique

    ■ Use '''Tools -> Options -> Applications ->''' <br> then look under content for Adobe Acrobat forms etc;
    <br> note a choice of options is usually available
    * see [[Options window - Applications panel]]
    Firefox is of course a web browser. <br>Acrobat reader is Adobe's program used to read and display the pfd files on your computer. Other programs may be used instead of Acrobat reader. You would normally have the Acrobat program and the pdf file present on the local computer, often both on the same hard drive, if you were opening individual pdf files directly with Acrobat.
    Firefox uses a plugin so that it may use Acrobat to open pdf files and display the results within a firefox window or tab. If you do not have that plugin installed, or it is not enabled firefox may be unsure what to do with the file and offer to save it to whatever your default local download location is, without attempting to open the file in firefox.
    ■Also see
    * [[Opening pdf files within firefox ]]
    *[[Using the Adobe Reader plugin with Firefox]]

  • Bean Managed Persistence and Object Fields

    I'm having trouble persisting data in the fields in my EJB. I have posted the code for my EJB below:
    package com.kns.account.ejb;
    import java.sql.*;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    * @stereotype EntityBean
    public class AccountBeanEJB implements EntityBean
    public int id;
    public String username;
    public String password;
         * The container assigned reference to the entity
         private EntityContext context;
         * @return
         public AccountBeanEJB() {
         * Sets the context of the bean
         * @param ec
         public void setEntityContext(EntityContext ec) {
              context = ec;
              // to do: code goes here.
         * Clears the context of the bean
         public void unsetEntityContext() {
              this.context = null;
              // to do: code goes here.
         * This method is called when the container picks this entity object
         * and assigns it to a specific entity object. Insert code here to
         * acquire any additional resources that it needs when it is in the
         * ready state.
         public void ejbActivate() {
         * This method is called when the container diassociates the bean
         * from the entity object identity and puts the instance back into
         * the pool of available instances. Insert code to release any
         * resources that should not be held while the instance is in the
         * pool.
         public void ejbPassivate() {
         * @return
         public Integer ejbCreate(int theId, String theUsername, String thePassword)
              throws CreateException
    System.out.println("Creating new account");
         String sqlstr = "Insert into Account (ACCOUNTID, USERNAME, PASSWORD)";
         sqlstr = sqlstr + " VALUES(" + theId + ", '" + theUsername + "', '" + thePassword + "')";
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         System.out.println(sqlstr);
         this.id = theId;
         this.password = thePassword;
         this.username = theUsername;
         System.out.println("Done creating new account");
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
              return new Integer(this.id);
         public void ejbPostCreate(int id, String username, String password) {
         * @return
         public Integer ejbFindByPrimaryKey(Integer key)
              throws FinderException {
              // to do: code goes here.
              this.id = key.intValue();
              return (key);
         public void changePassword(String newPassword)
         this.password = newPassword;     
         * @return
         public int createAccount(String username, String password) {
              // to do: code goes here.
              return (0);
         public void ejbRemove()
         String sqlstr = "Delete * from Account Where ACCOUNTID = " + this.id;
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public void ejbLoad()
         System.out.println("In ejbLoad");
         String sqlstr = "Select * from Account Where ACCOUNTID = " + this.id;
         System.out.println(sqlstr);
         Connection conn = null;
         try
         conn = getConnection();     
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery(sqlstr);
         if(rs.next())
         this.password = rs.getString("Password");
         System.out.println("password = " + this.password);
         this.username = rs.getString("Username");
         System.out.println("username = " + this.username);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public void ejbStore()
         System.out.println("In ejbStore");
         String sqlstr = "Update Account Set Username = '" + this.username + "', Password = '" + this.password + "' Where ACCOUNTID = " + this.id;
         System.out.println(sqlstr);
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public String getPassword()
         //ejbLoad();
         return this.password;
         public String getUsername()
         //ejbLoad();
         return this.username;
         private Connection getConnection() throws ClassNotFoundException, SQLException
         Class.forName("weblogic.jdbc20.pool.Driver");
         return DriverManager.getConnection("jdbc20:weblogic:pool:pwxPool");
         public void removeAccount() {
    It seems like id, username, and password fields are not stored between calls. Here is some sample output from my weblogic server:
    Account found for id = 99
    in ejbStore
    Update Account set Username= 'null', Password ='null' Where accountId = 0
    Does anyone know how to fix this? I'm banging my head on the desk over here. Thank you.

    These functions always return null! Please help me!
    public String getPassword()
    //ejbLoad();
    return this.password;
    public String getUsername()
    //ejbLoad();
    return this.username;

  • Making the frame same size and same location as the field.

    In my report, some frames only contain one field. To save space, I need to make those frames same size (same width, same height), and same location as the field. It means the size and location of those frames should exactly match their fields.
    But, for those frames which only consist of one field, when I use the mouse to adjust their sizes and location to match their fields, Object Navigator will show that their fields moved outside of them. Is there anyway to solve this problem?

    Hello 1011308
    Hi in your case check out the lock object option into report builder.
    After Putting filed into parent fame , if u off the lock option , then field can go outside.
    just check onces.
    Thanks
    Harsh shah

  • Add one same literal to each and every field in a collection

    I need to add a semicolon to each and every field in my collection (I will afterwards write it to a CLOB and have the data opened in Excel as a CSV file).
    I mean I have a nested table with, say 10 fields. For each index in the collection, I need to build a string wich would be a concatenation of each and every value of all this index's fields - separated by a semicolon.
    Example:
    Say my nested table is my_collec, and it has 10 fields, col1, col2... col10.
    I have obtained my string the hard way - v_string := my_collec(1).col1 || ';' || my_collec(1).col2 || ';' ||... and so forth, till my_collec(1).col10.
    As I said, I have to do this for every index of my collection, so I would do that in a loop, rendering v_string := my_collec(2).col1 || ';' || my_collec(2).col2 || ';' ||... and so forth, till my_collec(2).col10 ... till the my_collec.last.
    Is there any built in method that allows me to loop through all a collection's fields/attributes ?
    Edited by: Veverke on Apr 25, 2010 2:49 PM
    Edited by: Veverke on Apr 25, 2010 2:55 PM

    Can you explain more what you mean with a collection?
    A small, simplified example?
    If not, any suggestions ?Maybe OWA_SYLK can be of use to you.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:769425837805
    More threads:
    http://asktom.oracle.com/pls/asktom/asktom.search?p_string=%22owa_sylk%22

  • Include structure and extra fields in the same Internal Table

    Hi developers,
    im trying to declare an internal table with include structure and extra fields,
    something like this:
    data: BEGIN OF it_loans occurs 0,
          include structure zthrca006,   
          status(10),
          pernr   like pa0001-pernr,
          sname   like pa0001-pernr,
          tipomov(20),
          monto   like zthrca006-monto,
    data: END of it_loans.
    zthrca006 is huge so i dont want to type everithing.

    What is the issue?
    data: BEGIN OF it_loans occurs 0.
                 include structure zthrca006.
    data :     status(10),
    data :     pernr like pa0001-pernr.
    data :     sname like pa0001-pernr.
    data :     tipomov(20).
    data :     monto like zthrca006-monto,.
    data:  END of it_loans.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Error to select data field of same length and same type.

    Hi,
    I have to select data from VBRK , VBRP and then from table CE4UCA1_ACCT based on the condition
    AKTBO   IN SO_AKTBO           AND
    PAOBJNR = LT_VBRK_VBRP-POSNR  AND
    PASUBNR IN SO_RKBNR           AND
    PRCTR   IN SO_PRCTR.
    So while coding it gave a syntax error saying that PAOBJNR & POSNR need to be of same length. To solve this I chagned the decalaration of POSNR from "POSNR TYPE POSNR" to "POSNR TYPE RKEOBJNR" and this corrected the error.
    Now I have to select data from KONV table based of the condition :-
    Get data from KONV table.
      select knumv
             kposn
             stunr
             kwert
         into table lt_konv
         from konv
         for all entries in LT_VBRK_VBRP
         where knumv = LT_VBRK_VBRP-knumv and
               kposn = LT_VBRK_VBRP-posnr and
               stunr = '950'.
    Here again it is throwing syntax error that LT_VBRK_VBRP-posnr should be of same type and same length. So please guide me how to solve this type of situation.
    Thank You,
    SB.

    Hi,
    select knumv
    kposn
    stunr
    kwert
    into table lt_konv
    from konv
    for all entries in LT_VBRK_VBRP
    where knumv = LT_VBRK_VBRP-knumv and
    ***--- Change to
    *kposn = LT_VBRK_VBRP-kopos and*
    stunr = '950'. For 4.6c system
    OR
    Pass VBAK-KNUMV to KONV-KNUMV
    VBAP-POSNR to KONV-KPOSN
    Edited by: Raj on Jun 17, 2008 2:27 AM

Maybe you are looking for