• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in storing date in database

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a problem in storing a date in database, please help me..............


this is my designservlet.java






this is my adddsg.jsp


 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sarojni agrwal wrote:i have a problem in storing a date in database


OK, so what's happening? ItDoesntWorkIsUseless (←click).

If you're getting an enormous stacktrace, just give us the first 10-15 lines.

Winston
 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried this one(designservlet.java), but in this line(Date activityDate = (Date) reFormat.parse(request.getParameter("startDate"));)
, it gives unhandled ParseException use try catch, how to handle this?




this is jsp




and these are the console lines



Jan 23, 2016 4:33:12 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [com.jw.designservlet] in context with path [/jewellery] threw exception [Servlet execution threw an exception] with root cause
java.lang.Error: Unresolved compilation problem:
Unhandled exception type ParseException

at com.jw.designservlet.doPost(designservlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Screenshot_2.png
[Thumbnail for Screenshot_2.png]
 
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sarojni agrwal wrote:I have tried this one(designservlet.java), but in this line(Date activityDate = (Date) reFormat.parse(request.getParameter("startDate"));)
, it gives unhandled ParseException use try catch, how to handle this?


The answer is in your own code starting at line 59.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sarojini ,

Your issue is resolved .If not first try to convert the string to date format and then apply the dateformat .
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic