Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9199829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:37:33+00:00 2026-06-17T22:37:33+00:00

I’m currently using the Spring framework, though I’m not sure if this is directly

  • 0

I’m currently using the Spring framework, though I’m not sure if this is directly the issue. I’m getting the following error:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:929)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:824)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:798)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    @SuppressWarnings({ "rawtypes", "unchecked"})
public List getAllByFilter( String collectionPeriod,String sYear, String submission) {
    // TODO Auto-generated method stub SELECT_QUERY_BY_COLL_MSTR

    List<CollectionCalendar> orgs1 = new ArrayList<CollectionCalendar>();        
    List<Map<String,Object>> rows1 = null;
    String query="SELECT_QUERY_BY_COLL_MSTR";

    if("All".equalsIgnoreCase(sYear) && "All".equalsIgnoreCase(collectionPeriod)){
        query="SELECT_QUERY_BY_COLL_MSTR_SUBMISSION";
         rows1 = getJdbcTemplate().queryForList(p.getProperty(query),new Object[] {submission});
    }else if(!"All".equalsIgnoreCase(sYear) && "All".equalsIgnoreCase(collectionPeriod)){
        query="SELECT_QUERY_BY_COLL_MSTR_SUBMISSION_YEAR";
         rows1 = getJdbcTemplate().queryForList(p.getProperty(query),new Object[] {sYear,submission});
    }else if("All".equalsIgnoreCase(sYear) && !"All".equalsIgnoreCase(collectionPeriod)){
        query="SELECT_QUERY_BY_COLL_MSTR_SUBMISSION_COLLECTION";
         rows1 = getJdbcTemplate().queryForList(p.getProperty(query),new Object[] {collectionPeriod,submission});
    }else if(!"All".equalsIgnoreCase(sYear) && !"All".equalsIgnoreCase(collectionPeriod)){      
         rows1 = getJdbcTemplate().queryForList(p.getProperty(query),new Object[] {sYear,collectionPeriod,submission});
    }
    System.out.println("hellooooooooooooooooooo");
    for (Map row : rows1) {
        System.out.println("row------"+row);
        CollectionCalendar collectionCalendar = new CollectionCalendar(row.get("COLL_KEY").toString(),
                (Date)row.get("COLL_OPEN_DT"),
                (Date)row.get("COLL_CLOSE_DT"),
                (Date)row.get("COLL_AVLBL_DT"),
                row.get("COLL_ACAD_YR").toString(),
                row.get("COLL_NAME").toString(),
                row.get("COLL_DESC").toString(),
                row.get("SUBM_DESC").toString(),
                row.get("UPDATE_USER").toString());
                //(Timestamp) row.get("UPDATE_DTTM"));            
        orgs1.add(collectionCalendar); (COMMENTED THIS OUT BUT STILL GETTING ERROR)
    }
    return orgs1;
}

public CollectionCalendar(String colKey,Date opDate,Date clDate,Date avDate,String sYear,String submission,String collectionPeriod,String subDesc,String updateUser){
    setCollKey(colKey);
    setOpenDate(opDate);
    setCloseDate(clDate);
    setAvailDate(avDate);
    setsYear(sYear);
    setSubmission(submission);
    setCollectionPeriod(collectionPeriod);
    setSubDesc(subDesc);
    setUpdateUser(updateUser);
    //setUpdateTime(updateTime);
}

What I have is a search form that queries the DB and returns results into a table. I’m pulling data from Oracle DB table where the column type is Date but for some reason it’s telling me that it cannot cast from a Timestamp value. I’m not requesting a Timestamp value at all.

Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:37:34+00:00Added an answer on June 17, 2026 at 10:37 pm

    It appears that one or all of COLL_OPEN_DT, COLL_CLOSE_DT, and COLL_AVLBL_DT is a timestamp in the database. Luckily java.sql.Timestamp extends java.util.Date.

    Option 1

    Change the date elements in the CollectionCalendar class to be java.util.Date

    Option 2

    Create a class with a mehod that takes a java.sql.Timestampand returns ajava.sql.Date`

    Here is a simple example:

    class Blammy
    {
      static final java.sql.Date convertTimestamp(final java.sql.Timestamp timestamp)
      {
        java.sql.Date returnValue;
    
        if (timestamp != null)
        {
          returnValue = new java.sql.Date(timestamp.getTime());
        }
        else
        {
          returnValue = null; // an exception might be better here.
        }
    
        return returnValue
      }
    }
    

    Then change the code above to something like this:

    ...
    Blammy.convertTimestamp(row.get("COLL_OPEN_DT")),
    ...
    

    Option 3

    Something else (that I did not think of).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.