• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to fetch date from database in JDateChooser field

 
Fahim Khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created simple form in swing. Which uses JCalendar.

I am trying to view the data from database on the basis of id. All other field are listing fine except date field. Which is JDateChooser component.

I am using below code to set the field.


Thanks in advance
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and welcome to the Ranch!

Can we see the exception message you are getting? I guess tfdob is JDateChooser component?
 
Fahim Khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is JDateChooser componet.

I am getting SQLException from line tfdob.setDate(rs.getDate("DOB"));

I think I got the solution I have defined DOB as String in database that may causing exception
 
ahmad irfan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks fahim khan. It work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic