Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes problem with inserting data using Jsp and Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with inserting data using Jsp and Servlet " Watch "problem with inserting data using Jsp and Servlet " New topic
Author

problem with inserting data using Jsp and Servlet

athi ram
Greenhorn

Joined: Feb 28, 2011
Posts: 6
DataBase:PostgreSQL8.3
Table:



Jdk1.6

//ServletUser.java



//AddForm.jsp





i am using Eclipse

Steps:http://localhost:8081/AddDataBase/

i got output ----->Record has been inserted
but no data in sample table.

i want know how to show jsp page first after i insert different data to sample table

please help me
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Athi,
In my opinion, based on the information you provided, this is not a JDBC question.
In your file AddForm.jsp:

<form name="TestForm" method="post" action="/ServletUser">

This means the doPost method in servlet ServletUser will be invoked.
However I could not find the code for method doPost in the servlet code you posted, only the doGet method.
Nonetheless you claim that the servlet code is being executed.
This means you have either supplied incomplete or erroneous information which makes it difficult for others to help you.
You ask:

i want know how to show jsp page first after i insert different data to sample table

Which JSP page are you referring to? AddForm.jsp ?
How is this related to your claim that after the servlet method executes, you are seeing no data in the database?

Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with inserting data using Jsp and Servlet
 
Similar Threads
send variable value from one servlet to another servlet for itext pdf
servlets using JDBC
Getting Error :HTTP Status 405 - HTTP method GET is not supported by this URL
Not able to add values in a database
Servlet and JDBC.