-
1. Re: unable to update table through CMP
dries.demoor Nov 1, 2003 3:44 AM (in response to srikanth.d)Hello,
I don't think you have to change something in the jbosscmp-jdbc.xml
Just lookup the bean you want to change using a CMP
findermethod and call the setxxx(new Value) method on it. This will do the job.
Regards,
Dries -
2. Re: unable to update table through CMP
srikanth.d Nov 1, 2003 9:28 AM (in response to srikanth.d)thank you,
but my requirement is update table_name set empname=3 where emp-id=2
emp-id is primary key.
please explain in detail
Regards,
Sathish -
3. Re: unable to update table through CMP
didi1976 Nov 3, 2003 3:15 AM (in response to srikanth.d)Hi,
lets assume you have an bean called "Emp". You are using it locally on the server (otherwise you have to narrow the Object). The Bean is bound in the JNDI to "ejb/local/EmpBean". The primary key is of type java.lang.Long. So it could look like:
InitialContext ctx = new InitialContext();
EmpHome empHome = (EmpHome)ctx.lookup("ejb/local/EmpBean");
Emp emp = empHome.findByPrimaryKey(new Long(2));
emp.setName("3");
Regards,
Didi