Results 1 to 3 of 3
- 10-07-2010, 07:23 PM #1
Senior Member
- Join Date
- May 2010
- Posts
- 113
- Rep Power
- 0
How to capture the error message returned from the procedure and printit out.
Hi
I am working on a project , where i will call a procedure passing some information to the procedures parameters.
If the procedure doesnot receive the right parameter values ..it displays an error message .
How to capture the error message and print it out to the screen .
Java Code:CallableStatement proc_stmt; try { proc_stmt = connection.prepareCall("{? = call PKG_COMPARE.F_2_SCHOOL(?,?,?)}"); // Register the type of the return value proc_stmt.registerOutParameter(1,OracleTypes.CURSOR); proc_stmt.setInt(2,year); proc_stmt.setString(3,schoolname); proc_stmt.setString(4, version1); // Execute and retrieve the returned value proc_stmt.execute(); ResultSet rs = (ResultSet) proc_stmt.getObject(1); // ?????-----> WHAT CODE I NEED TO WRITE TO CAPTURE THE ERROR RETURNED FROM THE PROCEDURE ????
Thanks in advance .
- 10-07-2010, 08:02 PM #2
Here's a basic bit on exceptions: Lesson: Exceptions (The Java™ Tutorials > Essential Classes)
Here's how to get the error message: http://download.oracle.com/javase/6/...l#getMessage()
...and you will find other helpful links in that page also.
Best of luck!
- 10-07-2010, 08:51 PM #3
Senior Member
- Join Date
- May 2010
- Posts
- 113
- Rep Power
- 0
Similar Threads
-
capture db connection timeout error
By uthpalaw in forum JDBCReplies: 11Last Post: 09-09-2010, 11:45 AM -
Error Message ..
By Hamodi18 in forum New To JavaReplies: 15Last Post: 07-11-2010, 03:31 AM -
migration of Ms-sql procedure to My-sql Procedure
By kriss in forum New To JavaReplies: 0Last Post: 02-03-2010, 08:20 AM -
Error Message????
By Cubba27 in forum New To JavaReplies: 11Last Post: 11-21-2009, 02:46 PM -
java.lang.Error: Error opening DSound for capture
By NARs in forum NetworkingReplies: 1Last Post: 10-26-2009, 04:38 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks