on 07-23-2008 11:34 AM
hi all,
i need to crete a web service link for inserting and retrieving data from dictionary table..
i hv writtn the following code for showRecords()::::
public WrapperClass[] showRecords(
String title,
String desc,
String types,
String status,
Date start_date,
Date end_date,
String cc,
String comments)
{
ArrayList arr = new ArrayList();
try {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/SAP" + (String) System.getProperties().get("SAPSYSTEMNAME")+"DB");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet result = stmt.executeQuery("select * from CAT_TABLE");
while(result.next())
{
WrapperClass wrap = new WrapperClass();
wrap.setCC(result.getString("COST_CODE"));
wrap.setComments(result.getString("COMMENTS"));
wrap.setDescription(result.getString("DESCRIPTION"));
wrap.setEnd_date(result.getDate("END_DATE"));
wrap.setSt_date(result.getDate("START_DATE"));
wrap.setStatus(result.getString("STATUS"));
wrap.setTitle(result.getString("TITLE"));
wrap.setTypes(result.getString("TYPES"));
arr.add(wrap);
}
WrapperClass[] wrapArr = new WrapperClass[arr.size()];
for(int i= 0; i<=arr.size();i++)
{
WrapperClass wrapObj = (WrapperClass)arr.get(i);
wrapArr<i> = wrapObj;
}
conn.close();
return wrapArr;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
wrapper class is the getter and setter methods for all paramaters...
bt nw i cant create a constructor for this method ..
as it is reqd to bind with the context...
plz help me with the coding
Regards,
josita
HI,
What do you mean by creating constructor for method?
See, You can call BusinessMethods of SessionBean using
lookup only, either local or remote..
Incase of local, we are able to access the methods using
<SessionBeanName>LocalHome object only..
In case of remote, we use remote interface
<SessionBeanName>Home object..
Please explain clearly your problem..
Regards
LN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you are facing problem in statements like,
Request<RequestForMethod> objReq=new Request<RequestForMethod>();
wdContext.nodeRequest<RequestNode>().bind(objReq);
if yes, please make sure that, The object
of Request<RequestForMethod> and the mapped model node
are assosiated with same method or not..
what error you are getting?
Regards
LN
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.