Skip to content
Advertisement

Parameter index out of range (1 > number of parameters, which is 0) When trying to read SQL Table

So I am trying to get some data out of my SQL Table with this servlet and output it in a JSP file. I found some articles with similar problems to mine but none of them helped in my case. I Hoped someone here can help me.

I have to do this Project for one of my classes. I am basically programming an online shop for Clothing. If I click on for example t-shirts, I want this code to put out all data it can find under the sql table “t-shirts” into a JSP file.

From what i learned from other peoples mistakes is that my SQL Query is wrong. But i dont understand why it marks me line 39 as false When I call the Method display().

So Here is my Code:

JavaScript

And I get This Error message.

JavaScript

Advertisement

Answer

There are no bind parameters in your query. Remove

JavaScript

There is nothing to set. Also,

JavaScript

should be

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement