Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ensuring an sql query execution is successful

800610Dec 2 2008 — edited Dec 2 2008
Hi Guys

I have a bean which handles SQL statements. At the moment the methods do not return anything to the servlet, but I was thinking, if an error occurs whilst the statement is running then how should I inform the user to tell him an error has occured? Here is one of my current methods:
	public void executeUpdate(String Query) {
		try {
			stmt.executeUpdate( Query );
		} catch(SQLException e) { System.out.println("Exception : "+ e.getMessage()); }
	}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2008
Added on Dec 2 2008
22 comments
990 views