aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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
 
 
subject: Please help me on this insert statement and pass it to the servlet