This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tom Storm
Ranch Hand
Posts: 31
IntelliJ IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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.
 
Dave Tolls
Ranch Hand
Posts: 2103
15
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
IntelliJ IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you. I can't believe I spent so long trying to fix it!
TS
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic