Two Laptop Bag
The moose likes JDBC and the fly likes Please help me on this insert statement and pass it to the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Please help me on this insert statement and pass it to the servlet" Watch "Please help me on this insert statement and pass it to the servlet" New topic
Author

Please help me on this insert statement and pass it to the servlet

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Hello ,

I am performing a insert query on to the database in the DAO implemented Layer based on the AJAX request.

i need to inform to the JSP page about the status of the insert result to the jsp page.

int executeUpdate(String sql) , i am thinking in this way , if this returns 1 then its success or its failed operation . Is this correct?





If you want something you never had do something which you had never done
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

From the java.sql.Statement JavaDocs:

Returns:
either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Please help me on this insert statement and pass it to the servlet
 
Similar Threads
Unable to insert data into mysql
logout problem
Refresh problem
Can I use JavaScript inside a JSP page?
Not able to insert image more than 4K in Database