This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem storing form value into database  RSS feed

 
upanshu vaid
Ranch Hand
Posts: 83
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I was just doing a form input using JSP and servlet and storing result in MySQL ,concern I am having is that in the JSP I am not able to map the element to servlet I am using
JSP CODE:


Part of Servlet Code:


 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For starters, your code is wide open to SQL injection attacks - you should be using a PreparedStatement. Secondly, you're literally inserting the string value "employeeid" instead of inserting the value of the variable "employeeid".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!