sql - Print stored procedure message directly to Java console -



sql - Print stored procedure message directly to Java console -

i have stored procedure using

dbms_output.put_line(' output' || outvar);

i want print same output straight in java console (directly stored proc) without using below code outvar :

callablestatement.registeroutparameter(1, string); system.out.println(callablestatement.getstring());

change procedure function as:

function some_function homecoming varchar2 begin -- processing here.... homecoming 'output:' || ....; end;

back in java land:

callablestatement cs = connection.preparecall("{? = phone call some_function}"); cs.registeroutparameter(1, string); cs.executeupdate(); system.out.println(cs.getstring(1));

there no other way. got oracle, got ide console. there no relationship between two. info database, have utilize function homecoming value, argue returning values out parameters same thing, , while both value back, code much more intuitive others. says, phone call returns something.

that said, can phone call method in sql developer , print follows:

declare result varchar2; begin result := some_function; dbms_output.putline(result); end;

java sql oracle jdbc

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -