• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java SQL Time error in Constructor

 
Ranch Hand
Posts: 44
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have an oracle database application.

There the constructor of an auction is:


I can't somehow use the Constructor to create the object.

rset is the ResultSet:



I tried to convert java.util.date to java.sql.date but somehow the constructor does not recognize the new "sql" date.

The IDE wants that I change the java constructor to java.util.date

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the DATE class in your constructor?
Or is that a typo?
 
Kevin Olome
Ranch Hand
Posts: 44
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was a wrong Import.
I used oracle.sql.DATE;
and not java.sql.Date.

Is there a difference? Between the both Date's? I know that java.sql.Date and java.util.Date are different but between oracle and java?

Thanks for your answer,. It already solved my problem
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.sql.Date and java.util.Date are alsmost the same (the sql one is a subclass of the util one).

The oracle.sql.DATE is completely different and is (I believe) used by Oracles JDBC driver to do the conversion from the Oracle DATE/TIMESTAMP etc to the Java Date classes.

 
rubbery bacon. crispy tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic