How to print the DBMS output while calling a DB package through JAVA code

I want to enable DBMS output to be printed in my Java console while executing a Database package with the given input.

My Java code for executing the database package is as below. Here variable SQL is used to pass the calling database package.

callableStatement = conn.prepareCall(SQL);
callableStatement.registerOutParameter(1, Types.VARCHAR); 
callableStatement.setString(2, POS); 
callableStatement.registerOutParameter(3, Types.VARCHAR); 

How can I modify the above code to print the DBMS output?

Read more here:

Content Attribution

This content was originally published by Suresh Madhusanka Rodrigo at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: