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 6803253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:19:19+00:00 2026-05-26T19:19:19+00:00

I get the error JDBCExceptionReporter – incompatible data types in combination when running the

  • 0

I get the error “JDBCExceptionReporter – incompatible data types in combination” when running the following code:

    public Collection<SensorReading> getLastReadings(int[] sensorIds)
    throws DataAccessException {
            StringBuilder sb = new StringBuilder();
    sb.append("SELECT r ");
    sb.append("FROM Sensor AS s, SensorReading AS r ");
    sb.append("WHERE s.id IN (");
    for(int sensId:sensorIds){
        sb.append("'");
        sb.append(sensId);
        sb.append("',");
    }
    //strip off the last comma
    sb.setLength(sb.length() -1);
    //build the rest of the query
    sb.append(")  AND s.id = r.sensorId ");
    sb.append("   AND r.readingTimestampUtc >= s.lastBeaconUtc ");
    List<SensorReading> readings = getHibernateTemplate().find(sb.toString());
    //map to hold only the latest result
    Map<Integer, SensorReading> readingsMap = new HashMap<Integer, SensorReading>();
    //flash through the readings and make sure there's only one per sensor ID
    for(SensorReading rdg:readings){
        Integer sensorId = rdg.getSensorId();
        SensorReading reading = readingsMap.get(sensorId);
        if(reading==null){
            readingsMap.put(sensorId, rdg);
        }
        else{
            //replace if the new reading is later
            if(reading.getReadingTimestampUtc().after(rdg.getReadingTimestampUtc())){
                readingsMap.put(sensorId, reading);
            }
        }
    }
    return readingsMap.values();
}

sensor id and sensorreading sensorid are all integers and the other joins are dates. Any ideas why i might be getting this?

  • 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-05-26T19:19:19+00:00Added an answer on May 26, 2026 at 7:19 pm

    Yikes! The problem was the quotes around the IDs in the list.

    Why doesn’t hibernate deal with this properly?

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

Sidebar

Related Questions

I am using following PHP code for trigger creation but always get error, please
I have get error with the following code and i can't figure it out.
I get the following error while running my app. '-[NSCFString sizeWithTextStyle:]: unrecognized selector I
I Get Error when i use the following code str = Insert into BasicData
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
If I set pre-compile script into binary code to true I get error saying
How do I unit test my code that has LTS Datacontext. I get error
Some of my visitors get error while loading page: The following error was encountered:
I am running an END TRANSACTION on my database and occasionally I get error
I get error in C(Error- Unused Variable) for variable when I type in following

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.