twin yan wrote:still doing the same thing , what's the diffrence between with ' and without it worked both ways
any ideas on what's wrong with my prepared statment ?
Ok ' are for strings, you are making something convert a striping to an Integer when it isn't required.
The syntax of your prepared statement looks fine to me, so we must start looking at other areas of concern.
I can see a few possible problems
1) does the select return data? You just say result.next Without first checking there is a row returned.
2) if date1 is a database date field just inserting a
java default formatted date string could cause problems, much better to also make that a prepared statement then you can use the setDate method which is multi date format safe.
3) what values are returned from the select statement? Pop them into debugging statements to check the values, are they what you expect?
4) in your catch block simply use e.printStackTrace as that shows up red where ever the console output goes. You do know where console output goes?