Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Data is not getting inserted into database using servlet  RSS feed

 
stuj jv
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am trying to insert data using servlet but it is not getting into database.

I have a two JSP's form from which i enter the data and using servelt trying to insert the data into database.

can anyone help me out where i my code is wrong

JSP page code:

1.add_question_list.jsp
2.display_question_entry


Servlet code:


web.xml

 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Welcome to Coderanch.

Please make sure to wrap long lines and UseCodeTags while posting code. It makes posts more readable.
I've added code tags to your post above.

From the posted code, the part that inserts data into database is commented out.
Also it is a bad practice to put in the DB connection and manipulation code in the doxxx() method of the servlet.
 
stuj jv
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have uncommented the database code but still its not working
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please provide more information than "not working" ?

Is there an error message in the log? Stacktrace?
What behaviour do you see?
How are you invoking the code? What urls do you visit? What response do you get?

If you TellTheDetails we can help you a bit more.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!