oracle - Running a PL/SQL block using Java -


say have following procedure -

declare    enqueue_options     dbms_aq.enqueue_options_t;    message_properties  dbms_aq.message_properties_t;    message_handle      raw(16);    message             custom_payload_type;  begin    message := custom_payload_type('subject','body');     dbms_aq.enqueue(queue_name => 'my_demo_queue',                     enqueue_options      => enqueue_options,                 message_properties   => message_properties,               payload              => message,                         msgid                => message_handle);     commit; end; 

using spring jdbc created datasource> dont have procedure stored in data base. these procedure hardcoded in java side.

how run sql block using java?

use callablestatement:

string plsql = "..... code in here ..."; connection conn = datasource.getconnection(); callablestatement cstmt = conn.preparecall(plsql); cstmt.execute(); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -