• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in storing date in database

 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • 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


 
Winston Gutkowski
Bartender
Pie
Posts: 10571
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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]
 
Ron McLeod
Bartender
Pie
Posts: 1027
64
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Mark post as helpful
  • send pies
  • 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.
 
SajU Nadarsha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic