Hi Ranchers,
I'm trying to fetch a column from DB in my
java code but getting the below error.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.Exception
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.Exception
com.avon.gi.repsuite.ctrl.OnlineOrderDetailsController.handleRequest(OnlineOrderDetailsController.java:552)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
The column name is
ORD_MGMT_IP_DT and it is of Date format for example in my case it is
3/12/2010 9:27:11 PM in the db.
I need to fetch the date time and the AM/PM in the format
dd/MM/yyyy hh:mm:ss a
I tried fetching it by writing it as
to_char(rep_ord_trkg.ord_mgmt_ip_dt,'dd/MM/yyyy hh:mm:ss a') AS OrderDate in Java.
But am not getting the values on the page instead, I'm getting an Error 500 on page. When i tried without the 'a' i.e for the AM/PM i got the value in the page but the time was incorrect, like
12/3/2010 9:03:11. I'm quite confused that, how this is failing to fetch me the correct values when given with 'a' and it is throwing exceptions when given with 'a'.
Kindly help me out on this ranchers. Thanks a ton in advance.Awaiting your replies.