File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem storing form value into database

 
upanshu vaid
Ranch Hand
Posts: 83
Java
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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