This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JSP program error: "java.sql.SQLException: Invalid column Index"  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a program that creates a form for user input and displays the information in 3 separate SQL tables.

Here are the requirements of the program.
Implement a user interface (very basic) for your pilot project. Your Pilot Project will need to implement a minimum of the following interfaces into the database:
A menu page that links to all the pages in your project.
A page to create all required tables and insert the initial records needed for the application to function.
A page to drop all tables used in the project.
A form, that when submitted, inserts data into a database table(s).
A page the displays the data in the table(s) updated for verification.
The pages for this project should not be plain white pages.  Add a few images, styles sheets, etc. that enhance the pages' appearance.

Here is all the code I have so far. Please help!



INDEX.HTML


SAVETAGHANDLER.JAVA



SAVETAGHANDLER.LTD

WEB.XML


NAME.JAVA
 
author & internet detective
Marshal
Posts: 38504
653
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nathan,
Welcome to CodeRanch!

I edited your post to fix the code tags. Note they have to be around the code not before and after. Basically, select the code you want in a code tag and then press the code button.

Anyway, your problem lies here:

You call setString(), but there are no ? (binding variables) in the prepared statements.

Also, i strongly recommend specifying the columns rather than using select *.
 
Nathan Lad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jeanne, but I'm a little lost still. How would I go about setting binding variables in the prepared statements?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 38504
653
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like this:


Once you get it working for one row, you can add a loop to do this for each user.
 
Nathan Lad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried the above and it still isn't working. Could you please edit my code with any fixes? To be honest I'm not good with JSP or JAVA, I do like straight SQL but adding the other languages confuses me. I need Student_ID and Class_ID from their corresponding table to pull into StudentClasses table. I keep trying to edit my code to get it to work, but no luck yet.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 38504
653
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nathan Lad wrote:I've tried the above and it still isn't working. Could you please edit my code with any fixes? To be honest I'm not good with JSP or JAVA, I do like straight SQL but adding the other languages confuses me. I need Student_ID and Class_ID from their corresponding table to pull into StudentClasses table. I keep trying to edit my code to get it to work, but no luck yet.


No. If I edit your code, you don't learn how to do it. I'm not the one with a homework assignment.

When something doesn't work, start removing code until you have the simplest example that shows the problem. Then show that and what error message you get.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!