on 09-22-2006 12:29 PM
Hi,
Iam creating an application which retrieves data from an oracle database. Iam able to connect to the database and retrieve the data in a result set. Then I try to set these values in a context node as follows,
while (resultSet.next()) {
String name = result.getString(1);
String EmpId = result.getString(2);
IEmpNode node = wdContext.nodeEmp();
IEmpElement el = node.createEmpElement();
el.setName(name);
el.setEmpId(EmpId);
node.addElement(el);
}
where the context structure is emp(node)
---name(attribute)
---empId(attribute)
Then I have bound the node emp to a table ui element.If I try to deploy this it comes up with Internal Server error.
But if try this way, without creating a node, only with attributes name and empId,
wdContext.currentContextElement.setName(name);
wdContext.currentContextElement.setEmpId(EmpId);
and binding the attributes to inputfields in the view, Iam able to see the last record in the database table.
So where am I going wrong while using the table ui element?
Regards,
Rachel
Hi
Can u please mail me the sample code for this. I am looking for this only. I want to retreive data from table in the database using EJB module.
my id is abhi027@gmail.com
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is "result"? It is not changed inside the loop.
Also make sure that node "emp" has cardinality 0:N.
Can you post the stacktrace of the exception?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this
//Create the node in outer of while loop and bind to Table UIElement
IEmpNode node = wdContext.nodeEmp();
while (resultSet.next()) {
String name = result.getString(1);
String EmpId = result.getString(2);
IEmpElement el = wdContext.createEmpElement();
el.setName(name);
el.setEmpId(EmpId);
node.addElement(el);
}
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.