What's the format of the datasource tag in jbosscmp-jdbc.xml

Hi,
I made a CMP when I use Lomboz to generate the classes, and xml files, but I still don't know how to relate my CMP to datasource.
I thought may be I should configure the jbosscmp-jdbc.xml, because when I look in this file and found:
<defaults>
<datasource>PLEASE_MODIFY_THIS</datasource>
<datasource-mapping>PLEASE_MODIFY_THIS</datasource-mapping>
<preferred-relation-mapping>PLEASE_MODIFY_THIS</preferred-relation-mapping>
</defaults>
But I don't know how to "modify this", What do those tags mean? what are those for? and what are the Formats?
My database -- mySQL
datasouce xml file -- test-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/test</jndi-name>
<connection-url>jdbc:mysql://devsz-ma3.cn1.belton.com.hk:3306/test?useUnicode=true&characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>touchpanel</user-name>
<password>touchpanel</password>
</local-tx-datasource>
</datasources>
I need help, can you tell me some about that, thanks
next is my CMP entity bean:
package ejb.product;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
* @ejb.bean name="Product"
*     jndi-name="ProductBean"
*     type="CMP"
*  primkey-field="productId"
*  schema="Product"
*  cmp-version="2.x"
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.bean ejb-name="Product"
*     jndi-name="ProductBean"
* @jonas.jdbc-mapping  jndi-name="jdbc/test" jdbc-table-name="FL_PRODUCT"
*  @ejb.persistence
*   table-name="FL_PRODUCT"
* @ejb.finder
*    query="SELECT OBJECT(a) FROM Product as a" 
*    signature="java.util.Collection findAll()" 
* @ejb.finder
*       query="SELECT OBJECT(a) FROM Product a where a.NAME = ?1" 
*       signature="java.util.Collection findByName(java.lang.String name)" 
* @ejb.finder
*       query="SELECT OBJECT(a) FROM Product a where a.DESCRIPTION = ?1" 
*       signature="java.util.Collection findByDescription(java.lang.String desc)" 
* @ejb.finder
*       query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE = ?1" 
*       signature="java.util.Collection findByBasePrice(double basePrice)" 
* @ejb.finder
*       query="SELECT OBJECT(a) FROM Product " 
*       signature="java.util.Collection findAllProducts()" 
* @ejb.finder
*       query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE > ?1" 
*       signature="java.util.Collection findExpensiveProduct(double maxPrice)" 
* * @ejb.finder
*       query="SELECT OBJECT(a) FROM Product a where a.BASE_PRICE < ?1" 
*       signature="java.util.Collection findCheapProduct(double minPrice)" 
* This is needed for JOnAS.
* If you are not using JOnAS you can safely remove the tags below.
* @jonas.finder-method-jdbc-mapping  method-name="findAll"
*     jdbc-where-clause=""
* @jonas.jdbc-mapping  jndi-name="jdbc/test"
*     jdbc-table-name="FL_PRODUCT"
public abstract class ProductBean implements EntityBean {
     protected EntityContext ectx;
      * The  ejbCreate method.
      * @ejb.create-method
     public java.lang.String ejbCreate(String productId, String name, String desc,double basePrice) throws javax.ejb.CreateException {
          // EJB 2.0 spec says return null for CMP ejbCreate methods.
          // TODO: YOU MUST INITIALIZE THE FIELDS FOR THE BEAN HERE.
          // setMyField("Something");
          System.out.println("Entering ProductBean.ejbCreate()");
          setProductId(productId);
          setName(name);
          setDescription( desc);
          setBasePrice(basePrice);
          System.out.println("Leaving ProductBean.ejbCreate()");
          return productId;
      * The container invokes this method immediately after it calls ejbCreate.
     public void ejbPostCreate(String productId, String name, String desc,double basePrice) throws javax.ejb.CreateException {
     * Returns the productId
     * @return the productId
     * @ejb.persistent-field
     * @ejb.persistence
     *    column-name="PRODUCT_ID"
     *     sql-type="varchar"
     * @ejb.pk-field
     * @ejb.interface-method
     * This is needed for JOnAS.
     * If you are not using JOnAS you can safely remove the tags below.
     * @jonas.cmp-field-jdbc-mapping  field-name="productId"
     *     jdbc-field-name="PRODUCT_ID"
     public abstract java.lang.String getProductId();
     * Sets the productId
     * @param java.lang.String the new productId value
     * @ejb.interface-method
     public abstract void setProductId(java.lang.String productId);
     * Returns the name
     * @return the name
     * @ejb.persistent-field
     * @ejb.persistence
     *    column-name="NAME"
     *     sql-type="varchar"
     * @ejb.interface-method
     * This is needed for JOnAS.
     * If you are not using JOnAS you can safely remove the tags below.
     * @jonas.cmp-field-jdbc-mapping  field-name="name"
     *     jdbc-field-name="NAME"
     public abstract java.lang.String getName();
     * Sets the name
     * @param java.lang.String the new name value
     * @ejb.interface-method
     public abstract void setName(java.lang.String name);
     * Returns the description
     * @return the description
     * @ejb.persistent-field
     * @ejb.persistence
     *    column-name="DESCRIPTION"
     *     sql-type="varchar"
     * @ejb.interface-method
     * This is needed for JOnAS.
     * If you are not using JOnAS you can safely remove the tags below.
     * @jonas.cmp-field-jdbc-mapping  field-name="description"
     *     jdbc-field-name="DESCRIPTION"
     public abstract java.lang.String getDescription();
     * Sets the description
     * @param java.lang.String the new description value
     * @ejb.interface-method
     public abstract void setDescription(java.lang.String description);
     * Returns the basePrice
     * @return the basePrice
     * @ejb.persistent-field
     * @ejb.persistence
     *    column-name="BASE_PRICE"
     *     sql-type="double"
     * @ejb.interface-method
     * This is needed for JOnAS.
     * If you are not using JOnAS you can safely remove the tags below.
     * @jonas.cmp-field-jdbc-mapping  field-name="basePrice"
     *     jdbc-field-name="BASE_PRICE"
     public abstract double getBasePrice();
     * Sets the basePrice
     * @param double the new basePrice value
     * @ejb.interface-method
     public abstract void setBasePrice(double basePrice);
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbActivate()
     public void ejbActivate() throws EJBException, RemoteException {
          System.out.println("ejbActivate() called.");
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbLoad()
     public void ejbLoad() throws EJBException, RemoteException {
          System.out.println("ejbLoad() called.");
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbPassivate()
     public void ejbPassivate() throws EJBException, RemoteException {
          System.out.println("ejbPassivate() called.");
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbRemove()
     public void ejbRemove() throws RemoveException, EJBException, RemoteException {
          System.out.println("ejbRemove() called.");
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#ejbStore()
     public void ejbStore() throws EJBException, RemoteException {
          System.out.println("ejbStore() called.");
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
     public void setEntityContext(EntityContext arg0) throws EJBException, RemoteException {
          this.ectx = arg0;
     /* (non-Javadoc)
      * @see javax.ejb.EntityBean#unsetEntityContext()
     public void unsetEntityContext() throws EJBException, RemoteException {
          this.ectx = null;
}

you can try this
<defaults>
<datasource>java:/jdbc/test</datasource>
<datasource-mapping>MySQL</datasource-mapping>
<create-table>false</create-table>
<remove-table>false</remove-table>
</defaults>
JaimeS

Similar Messages

  • Where does FireFox get the default value of a preference from. What is the format of the file that has the default value?

    Where does FireFox get the default value of a preference from. What is the format of the file that has the default value?. I need the actual default value for a particualr preference.
    About:config does show some default values but I need the source from which about:config picks up the default value.
    Any help in this direction is greatly appreciated.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    The prefs that aren't hidden if they are the default are stored in two JavaScript text files in the Firefox program folder
    You can open them via these links in a Firefox tab:
    <code>resource:///defaults/pref/firefox.js
    resource:///greprefs/all.js
    </code>
    ([/forum/1/702598])

  • What type of format is the PowerPC processor?

    Just a simple question, what type of format is the PowerPC processor? I know Intel processors on later Macs is GUID.

    Apple Partition Map is the PowerPC partitioning scheme equiv to GUID on Intel Macs. However, the format is normally Macintosh HFS+ (Journaled)

  • HT1296 how do I sync movies from my PC to my IPad & what should be the format of the videos?

    how do I sync movies from my PC to my IPad & what should be the format of the videos?

    Pad2, the new iPad Supported Video Formats & Movie Formats
    H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    Another way. You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Secrets of the iPad Camera Connection Kit
    http://howto.cnet.com/8301-11310_39-57401068-285/secrets-of-the-ipad-camera-conn ection-kit/
     Cheers, Tom

  • How can I insert a line that extends from a word without it affecting the formatting of the WHOLE document?

    I am trying to create a simple form for people to print out and fill in. I want fields like 'Name' with a line extending from the word for people to write on. What should be the simplest of tasks has confounded me for HOURS. Inserting a line as a 'shape' or 'drawing with pen' just messes up the formatting of the whole document. I've used Pages 'Help' but it almost forced me to staple my eyelids to the carpet. Surely there is a SIMPLE way to do this. I even tried 'tricking' Pages by 'underlining' a row of spaces. It won't even allow you to do this because Pages is far more clever than a human.
    My cat is looking at me with increasing consternation.

    I would use a right-aligned tab with an underline leader.

  • Does Time Machine backs up also the format of the volume?

    Since many softwares cannot be installed on case-sensitive volume, so I erased the whole volume and install OS X Mountain Lion with format of OS Extended(Journaled). Then I use Time Machine backing up to the new system.
    But now when I'm trying to install Adobe softwares, here's what I see.
    still, It hints that this is a case-senstive volume.
    Then I go to check the Disk Utility:
    Very weired! It shows as "Mac OS Extended(Journaled) in the Drop-down list, but "case-senstive, journaled) in the discription in bottom.
    Anyone has some clues of this??
    Thanks.

    As well as doing backups and other things, you can use Disk Utility to create RAID volume sets. 
    Returning to the image you posted, RAID is selected at (1) and so it thinks you are about to create a RAID volume.  The format for the new volume would be as shown at (2).  On the other hand, the volume at (3) is selected and it is that volume's format which is shown at (4). 
    I don't think you wanted to create a RAID set; maybe Disk Utility got a click you didn't intend for it.  RAID is explained a bit in the Disk Utility help.
    I have found a lot of good information about Time Machine at this site: 
      http://pondini.org/OSX/Home.html
    To go back to your original question: 
    > Does Time Machine backs up also the format of the volume?
    My guess would be "No"; but see pondini.org for a definitive answer.

  • How to change the format of the cell in input schedules

    Hi gurus
    I tried to change the format of the cel in input schedulesl, but I can not, for example
    when I insert 80 in the cell, and i send the data the system switches to -80 and the report shows (80) y when i insert -80, the system switches the number to 80
    I want it when you insert 80, the system keeps 80 and do not change
    Anyone know how to do that?
    thanks
    regards

    Hi,
    The other experts have guided you with the steps to change the property. However, you need to understand why is the design like this and what impact can it have on your system.
    Usually, the accounts defined belong to the PnL or BL statements. There definitely can be some other accounts as well. The PnL and BS accounts can be either income (INC), expense (EXP), asset (AST) or liability and equity (LEQ). Changing the account type of these type of accounts can heavily impact your financial statements. So, you should carefully think over this before changing the property.
    Hope this helps.

  • How to get the format of the uploaded file ?

    Hi !!
    I am developing a web application, which allows user(client) to upload a file.
    I have to place that file in corresponding directory like image, sound, text on server-side.Here........ I am facing a problem to find the Format of that file.
    I used 'ImageInfo.java' to find the format of the image files and I am unable to find the format of the Text, Sound files.
    if user changed the file name from 'file.txt' to 'file.jpg', the action class has to indentify it. Vice Versa......
    Please Help me !!!!!
    Thanks in Advance :-)

    Thank you.
    Yes, you are right!!!
    But i am using ' org.apache.struts.upload ' package . where getContentType() method in this package, gets the mimeType of the file. Its returning the type- by its extension not by its (File)Format.
    I don't know ... I am trying to find the solution.....
    Once again thanks.........

  • "recording stopped because the format of the source media changed" Error

    I am trying to import video from my digital camera via firewire to quicktime...
    the New movie recording screen appears and works, but after a random amount of time (normally just around 4 minutes..) the recording stops and the message appears..
    "recording stopped because the format of the source media changed"
    I have plenty of disk space, and am sending the output vid to the desktop..
    please help.. I have spent 3 days trying to record the vid...
    I cannot import via imovie because I want to have the sound come from a different source then the movie.. i.e. Quicktime lets me get vid from DV and sound from "saffire" sound card..
    Thanks
    Geoff

    Jon Walker wrote:
    This is an older model Sony prosumer 3CCD camera that records to mini-DV tape.
    So does the HC3 and I have to re-set the camcorder output to match the capture settings each time I switch modes. However, I don't use QT for capture since the ability to maintain frame rate is dependent on the platform's CPU power. As you feel the problem is tied to your use of QT Pro, why not download and try the free Vidi dedicated capture utility.
    I'll check out vidi. I'm not familiar with it. I've been using this same method to capture clips for several years. I pretty much set the camera once and never have to mess with it again. I don't switch the mode at all during the day.

  • I hired a commercial artist to create a color image for the cover of a self published book. I want a black and white image for the inside. The commercial artist has not responded to this request. How do I determine the format of the color image, I'm guess

    I hired a commercial artist to create a color image for the cover of a self published book. I want a black and white image for the inside. The commercial artist has not responded to this request. How do I determine the format of the color image, I'm guessing it's Illustrator's formatting but I don't know. How can I find out if Illustrator will open the file and allow alterations? The image opens only in Apple's Pages software?

    rons,
    It seems that all you have is a raster image, presumable PNG24 or JPEG, in RGB.
    It may have been created as raster artwork in Photoshop, or it may have been created as vector artwork with the help of Illy, or as a mixture of vector and raster artwork in either application, or both combined.
    If you just need to have a raster representation in black and white based on the current colour image, you may try this, in a new RGB document (View>Smart Guides are your friends):
    1) File>Place the image (you may tick Link or untick and have it embedded);
    2) Create a rectangle with black fill (R = G = B = 0), at least as large as the image, and place it behind the image (you may ClickDrag with the Rectangle Tool between opposite corners, then Ctrl/Cmd+X+B);
    3) Select all and in the Transparnecy palette flyout click Make Opacity Mask with both Clip and Invert Mask ticked.

  • How to change the format of the display_name

    Hi,
    Does anyone have an idea, how can I change the format of the display_name of the employee to First_name|| last_name? I do not want to include the title in the name format. This is for India Localisation.
    I tried changing the HR profile value "Default full name format". But the format of full_name does not change.
    your response would help me alot
    Thanks
    Mano

    Pl post full versions of your OS, EBS and HR patch level. Pl see if these MOS Docs can help
    362229.1 - How to Display Full Name as Surname PreferredName
    359995.1 - How to Access Global Name Format Functionality
    HTH
    Srini

  • Excel cannot open the file beacuse the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file [help]

    Hi,
    I have a excel file that I have been using since beginning of year.
    Yesterday, I tried to open it but a message comes out "
    Excel cannot open the file beacuse the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"
    After I click yes, the page is blank. The file is about 400kb in size.
    I have try open and repair and third party repair program and not working also.
    I would appreciate a lot if you can help me.
    Thank you very much.

    Per your post, this problem might be caused by malware on the affected machine.
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx
    In order to clean your machine, run Microsoft Safety Scanner (http://www.microsoft.com/security/scanner/en-us/default.aspx) to kill the malware, and then repair Excel file itself.
    If this is not the case, feel free to post back and let me know. Thanks.
    Tony Chen
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • KEYNOTE: Why change the format of the presentations? not respect the original format!

    Why change the format of the presentations? Keynote not respect the original format!
    This new versionof Keynot (6.1-1769) is very poor:
    is very slow
    missing fonts
    changes the selected letters
    change the formats of the presentations
    Carousel animations missing
    Please correct the defects before releasing a new version. (The previous version was much better).

    Found the solution!
    I must set the Formats in the CODEC to get the Format that I want to play with! I was trying to complicate too much!
    The correct format class to is RGBFormat.
    RGB

  • The value entered does not match the format of the field

    I am trying to do a simple division of profit by sales to find the profit %. Here is the script I am using and it doesn't work.
    var v1 = +getField("Profit%").value;
    var v2 = +getField("Contract1").value;
    event.value = v2 !== 0 ? v1 / v2 : "";
    I continue to get the error The value entered doesnot match the format of the field
    I have attached the file. Can someone help

    Are you very sure?
    Using
    var v1 = 0.05; // "Profit%"
    var v2 = 100000; // "Contract1"
    v1 / v2; // result of division;
    5e-7
    That is 5 * 10 exponent -7 or 0.00000005
    Set the format to "None"
    Also so please post the values you are using.

  • I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    I have a numbers spreadsheet for tracking company data.  I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year.  How do I do that?

    click and hold on one cell, then drag to select the range, then release, then type the delete key.  Only inlude cells in the range you do not want to keey the contents of the cell.  You can remove one-off cells by holding the command key and clicking cells to add or remove as needed.
    You can download the Numbers users guide here:
    http://support.apple.com/manuals/#productivitysoftware

Maybe you are looking for

  • Why is Premiere 6 giving a "Error writing file (disk full?)" message?

    Hello helpful experts, I'm using Premiere 6 on a Windows 7 machine. I have a file imported in to the timeline and it is set to play in reverse via the speed setting being set to -100 and it plays back in the preview window correctly, in reverse, when

  • IPhone won't detect in whole computer

    My iPhone 3G can't be detected in my computer on iTunes or even windows explorer for that matter. Also when I plug it in, all my computer's usb ports seem to not want to detect anything either so that leaves me with a usb key and usb wireless mouse t

  • Please help - JVM

    I need help please! When I open pages with a java applet the Install on Demand prompt comes ("You need to install Java Virtual Machine"). If I press Download the Microsoft site comes ("No Java installed"), but then the applet loads perfectly well!! I

  • Cache data locally in an HTML file used in a folio.

    Hi I am using a form in an HTML page as a page in my folio, does anyone know how to cache the information locally so that the information in the form will stay when you navigate away from the page and back again. Alan

  • Adding lines of users TODO to motd

    Hello, I've been trying to customise radu242's /etc/issue from the thread https://bbs.archlinux.org/viewtopic.php?id=50845&p=3 into a user specific motd by replacing the text in the box with some lines from the users TODO.txt. At the moment I have a