Re: Help needed on custom tag
From: PaulE (paulevan_at_hotmail.com)
Date: 06/08/04
- Next message: PaulE: "Re: Problem closing server connection"
- Previous message: Charles: "Open Source Java/J2EE development distribution"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jun 2004 15:03:05 -0700
doodams@yahoo.com (sree) wrote in message news:<ce9047fa.0405302341.2d8dccbd@posting.google.com>...
> Hi all,
> I need to develop a Custom tag that retrieves the values from
> two database tables. first table has the some data and second table
> contains data matching to the primary key of first table.
> what i need to display on a JSP is
>
> 1st PK value of first table 2nd PK value of first table
> --------------------------- ------------------------
> here display data from second table here display data from second table
> matching for 1st pk of first table matching for 2nd PK value of first table
>
> on the side of the 2nd table data there shud b radio buttons displayed.
>
>
> can anybody send me the code samples of custom tags for
> accessing database.
>
> regards
> D.Sreenivas
Although I wouldn't recommend it for production the JSTL tags provide
sql:* tags for accessing a database.
You can see the documentation here:
http://www.jcp.org/aboutJava/communityprocess/review/jsr052/
just hit the pdf link. Also, googling for JSTL will get you many
samples.
My recomendation based on your description is to have a servlet use a
utility class to make the database calls, then store the results as
request parameters and dispatch to the JSP. The JSP would then NOT
have any code related to the database. It could simply output the data
using c:forEach and c:out tags.
- Next message: PaulE: "Re: Problem closing server connection"
- Previous message: Charles: "Open Source Java/J2EE development distribution"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]