jeudi 15 janvier 2015

JDateChooser Inserting and retriving from DataBase

Below are my Questions , already searched stackoverflow but none methods worked too good..


1.Which Component/external library is best while dealing with Dates in Java? Currently i am using JDateChooser .


2.Best wat to insert date into sqlite database? Currently i am using



addstudent.setString(4,((JTextField)DateOfAdmission.getDateEditor().getUiComponent()).getText());


I need to Store it as Date or String? Sqlite accepts input of this result as both String and Date ..



  1. How to retrive this value from Sqlite into jdatechooser?


I tried this code but it does not works



Date tmp1=rs.getDate("DateOfAdmission");
DateOfAdmission.setDate(tmp1);


Error i get is



java.sql.SQLException: Error Parsing timestamp



  1. How can i compare Values using Date in Database, Means like i want to get student admission details between 1st january to 1st febuary how to do it using jdatePicker


Aucun commentaire:

Enregistrer un commentaire