• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem while using prepared statement

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Ninad Sir,it worked perfectly well for timely reply... you are a savior.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic