• 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

Error mysql database : java.sql.SQLException: No value specified for parameter 32

 
Ranch Hand
Posts: 31
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attempting to add the following data to a localhost mysql database. I extract information from files and then I try to add it to the database with the following code. If I remove one of the parameters the problem continues to persist on the last parameter. Am I doing something incorrectly or is the code correct?


Thanks to all who reply.
TS
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to use "++col" wherever you have "col++" now. As it is, parameter 1 is set twice.
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I think you need to use "++col" wherever you have "col++" now. As it is, parameter 1 is set twice.



Either that or do col++ for the first assignment, rather than just col.

(Always looking for the least typing...)
 
Tom Storm
Ranch Hand
Posts: 31
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to both of you. I can't believe I spent so long trying to fix it!
TS
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The parameter count can be an issue using such an approach. The other issue is that the sql statement (line with ?) does not have the correct number of ?!!

Either one happened to me in the past. lol
 
reply
    Bookmark Topic Watch Topic
  • New Topic