Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ejb3 constructor

Status
Not open for further replies.

iscsi

Technical User
Nov 30, 2008
1
HU
Hi,
i'm new in j2ee.. So i made a stateless session bean, my ejb skeleton is:
i hava a query.jsp page, which request a query (string), after that the ejb Bean connect an Oracle database,
the ejb ha a rank function which ranking the resultset, after that i show the result a result jsp page. this works:)
but, i would give some choice for the users to the query.jsp, for what column would they look like, to the result.jsp.
So i think my bean should look like:

constructor (String query){connect to database..;
rank();
}
get() methods..

destructor (){disconnect;}

So i know i don't know the ejb concepts to much so i ask some idea, how i should realize what i would like.
I haven't find how possible write a constructor for a bean class, and how can call it. For example my result.jsp : i don't know where the c

QueryRemote queryr = null;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
queryr = (QueryRemote) ic.lookup("query/QueryBean/remote");
..}

So my question is there any option, to call a constructor with an argument?
Or what do you advice for my problem? I 've interested any idea..

Thanks in advance..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top