One more thing ;-). If you really have to do your DB access and processing from 
within a JSP, you should check out an implementation of JSTL (like the Jakarta 
Standard Taglib). It requires a JSP 1.2 container. It also includes formatting 
actions...

Quoting Kris Schneider <[EMAIL PROTECTED]>:

> I've never used that taglib, but ResultSet.getString returns a String, not a
> 
> Date. Try ResultSet.getDate.
> 
> Quoting Jeff Self <[EMAIL PROTECTED]>:
> 
> > I've got a JSP page that is retrieving information from a PostgreSQL
> > database. One of the fields is a datefield. Here's the code to what I'm
> > displaying:
> > 
> > while (rs.next()) {
> > %>
> > <tr>
> >   <td><%= rs.getString("position_code") %></td>
> >   <td><%= rs.getString("effective_date") %></td>
> > </tr>
> > 
> > When it displays, the date shows up in the following format: 2002-11-14
> > 
> > I'd like it to show up as '11-14-2002'. I'm trying to use the datetime
> > taglib so I tried it like this:
> > 
> >   <td><dt:format pattern="mm/dd/yyyy"><%=rs.getString("effective_date")
> > %></dt:format></td>
> > 
> > But when I run the JSP now, It says invalid date instead of showing the
> > date.
> > 
> > What am I doing wrong?
> > 
> >             
> > -- 
> > Jeff Self
> > Information Technology Analyst
> > City of Newport News
> > Personnel Department Suite 200
> > 700 Town Center Drive
> > Newport News, VA 23606
> > 757-926-1810
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:taglibs-user-help@;jakarta.apache.org>
> > 
> 
> 
> -- 
> Kris Schneider <mailto:kris@;dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
> --
> To unsubscribe, e-mail:  
> <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:taglibs-user-help@;jakarta.apache.org>
> 


-- 
Kris Schneider <mailto:kris@;dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to