• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

SQLException : not all variables bound

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting SQLException while trying to insert a record in student table

output:
SQLException caught : not all variables bound



ng an Exception while trying to add a record into a database

[edited to add code tags]

[ April 12, 2005: Message edited by: Jeanne Boyarsky ]
[ April 14, 2005: Message edited by: Bear Bibeault ]
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhavik,
This line of code is causing the error.


For a prepared statement, you need to call the executeUpdate() method without any parameters.
 
Bhavik Patel
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne....Thank you for pointing out syntax error....i don'tunderstand why i was not getting any syntax error for that statement
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by bhavik patel:
i don'tunderstand why i was not getting any syntax error for that statement



You will not get a syntax error because PreparedStatement interface extends Statement interface, and Statement interface has method executeUpdate(String sql)


thanks
 
Onion rings are vegetable donuts. Taste this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic