on 04-15-2009 11:38 AM
Hi,
I need to develop an EJB application that accepts either Table / Structure as input. can any one guide me how to take Table/Structure as input parameters to EJB application.
Regards,
Lakshmi
Hi Lakshmi,
You can use Bean as an input for your Session bean business method.
Create a java class like below: (This bean has two attributes id and name. Write setter and getter method for each attribute to get and set the attributes from outside this class.)
public class SampleBean{
private String id;
private String name;
public String getId() {
return id;
}
public void setId(String string){
id = string;
}
public String getName() {
return name;
}
public void setName(String string){
name = string;
}
}// end of samplebean
Use the above bean as input parameter for the business method.
// Session bean business method:
public String createUser(SampleBean userdetails)
{
// Get the user details using getter methods
// userdetails.getId()
// userdetails.getName()
}
Similarly you can create a bean which matches your requirement.
Regards,
Jaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.