简体   繁体   中英

How to run declare statement of sql through jdbc?

I have a block containing declare begin and end statements which I need to run before doing a process. Presently I am doing it manually in sql developer in IBM db2 database but I need to automate the process with java. So for that I need to run the declare block using jdbc. The block is as follows:

DECLARE
    rep_id number(20);
    qz_dt date;
begin
    ou_id='GNDBKSNGH';
    ou_val='1000';
end
/

Can anybody please help me out in calling this block through jdbc??

您应该在db2中创建一个过程,然后使用db2驱动程序可以执行此过程

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM