• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

ORA-01008: not all variables bound

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you please tell where I am wrong, This is urgent.

String count = new String("select count (*) from Detail where" +" serviceCode = '" + service_code + "'" + " and " + " OFFERINGNO= '" + + "'");

try
{
stmnt = conn.prepareStatement("select count (*) from Detail where serviceCode = ? and OFFERINGNO = ? ");

stmnt.setLong(1, service_code);
resSet = stmnt.executeQuery();
while(resSet.next())
{
cont = resSet.getInt(1);
}
resSet.close(); // Release cursor
stmnt.close();
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swetha,
You have supplied only one argument to prepared statement but in query 2 arguments are required.

serviceCode is set by
I thing you forgot to set
 
reply
    Bookmark Topic Watch Topic
  • New Topic