Using DataSource object with JNDI

R

ros

Hi,

I am working on this exercise and would be thankful if somebody could
point me in the right direction to tackle it.

Create a servlet that displays a list of customers (From the customer
table of the database). Use the HTML table to organize the display.

Hint: Use a Java Bean, e.g. CustomerBean that has the fields of 'First
Name', 'Last Name' and 'Date of Birth'. And when the query returns the
result set, you will need to populate each CustomerBean and add them
to an ArrayList. Then return the collection object to the servlet,
loop through the collection and display the result.

I have learnt to display data in an html table directly from a servlet
connected to a database via jdbc. But I do not understand how to use a
JavaBean to attain that as advised in the 'hint'.

I do not expect the solution but suggestions are welcome. If you know
of any online resource, or a book that deals with this topic, it would
be really helpful.

Thanks
 
L

Lew

ros said:
Hi,

I am working on this exercise and would be thankful if somebody could
point me in the right direction to tackle it.

Create a servlet that displays a list of customers (From the customer
table of the database). Use the HTML table to organize the display.

Hint: Use a Java Bean, e.g. CustomerBean that has the fields of 'First
Name', 'Last Name' and 'Date of Birth'. And when the query returns the
result set, you will need to populate each CustomerBean and add them
to an ArrayList. Then return the collection object to the servlet,
loop through the collection and display the result.

I have learnt to display data in an html table directly from a servlet
connected to a database via jdbc. But I do not understand how to use a
JavaBean to attain that as advised in the 'hint'.

I do not expect the solution but suggestions are welcome. If you know
of any online resource, or a book that deals with this topic, it would
be really helpful.

SIYF:
<http://java.sun.com/blueprints/corej2eepatterns/Patterns/DispatcherView.html>

-- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top