Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using Apache Camel framework of java in which I am fetching the data from oracle db with a column of type timestamp . When I am trying to map this to variable of type java.util.Date , it is throwing the following error mentioned.

Caused by: java.lang.IllegalArgumentException:
Could not find a suitable setter for property lastupdated as there isn't a setter method with same type oracle.sql.TIMESTAMP nor type conversion possible: 
No type converter available to convert from type oracle.sql.TIMESTAMP to the required type java.util.Date with value "2022-11-16 19:04:27.067"

Can anyone help me with this?

I tried to use the following datatypes of java-

  • java.util.Date
  • oracle.sql.TIMESTAMP
  • java.sql.Timestamp
  • But still the error is same.

    create a camel convertor and add it camel context annotation can be change for spring + camel or quarkus + camel it is basic camel annotation

    @Converter(generateLoader = true)
    public class DateConvertor {
        @Converter
        public static java.sql.Timestamp toTimeStamp(oracle.sql.TIMESTAMP timestamp) {
            return timestamp.timestampValue()
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.