Hi Everybody
I have deployed few beans using J2EE reference
implementation server.
But there is a strange problem with my beans.....It
might be a silly mistake but please help me in
that......
I have deployed a simple CMP entity bean called
Product which has 3 fields
productid varchar pk
description varchar
price double
and String as the primary key
corresponding table called Product has same 3 fields
in the database.
I have defined a create method with all 3 params and
few finder methods like findByDescription(String name)
findByPrimaryKey(String pk) etc.
When I create a bean with create() method a bean gets
created and a row gets inserted in the table.
Also when I try to locate a particular bean with any
of the finder methods the bean gets located.
But the problem is when I try to print the values
using the getXXX() methods in the remote interface it
prints null for description[varchar] and 0.0 for
price[double] whereas it prints primary key of the
bean properly using getprimaryKey().
e.g. I use following code
Context initial = new InitialContext();
Object objref = initial.lookup("MyProduct");
ProductHome home =(ProductHome)
PortableRemoteObject.narrow(objref,ProductHome.class);
Collection c = home.findByDescription("ABC");
Iterator i = c.iterator();
while (i.hasNext()) {
Product product = (Product)i.next();
String productId = (String)product.getPrimaryKey();
String description = product.getDescription();
double price = product.getPrice();
System.out.println(productId + ": " + description + "
" + price);
}
which prints primary key for productid , null for
description and 0.0 for price ...I tried with 2
databases Cloudscape and MS Access..for both it gives
same results.
With normal JDBC same query gives correct results. It
happens with all the deployed beans also with a BMP
entity bean.
Is it the problem with the finder query, with J2EE
server or with the underlining database.
Please help me if anybody can throw some light on it.
Thanks in advance
Rupesh
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger.
http://im.yahoo.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".