cancel
Showing results for 
Search instead for 
Did you mean: 

How to take Table/Structure as input parameters for EJB application

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.