• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while using prepared statement

 
Aashima Upadhyaya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created the following program using prepared statement, but I am not able to go through and fetch its output accordingly.Please help.This is the program




Thanks in advance.

Aashima Upadhyay
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34225
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aashima,
Welcome to CodeRanch!

Just to make sure I'm understanding the problem correctly:

Works as expected:


Doesn't work as expected:


Can you try it with the values hardcoded in both as I have it (with the correct values of course.) I'm wondering if the variable somehow doesn't have what you expect. The JDBC looks fine.
 
Aashima Upadhyaya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot but it still doesn't works. The code doesnt gives any error at any step but the value of s1 and s2 doesnt reaches to the query



I tried inserting the value manually in place of s1 and s2 it works perfectly well. Please help me out...

love,

aashima
 
Ninad Kulkarni
Ranch Hand
Posts: 802
Hibernate Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Aashima

Instead of constructor use following assignment operations in action performed method at line number 45 & 46


Let us know whether values are comming or not after above change
 
Aashima Upadhyaya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Ninad Sir,it worked perfectly well for timely reply... you are a savior.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic