[英]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. 我有一个包含声明的begin和end语句的块,我需要在执行过程之前先运行它们。 Presently I am doing it manually in sql developer in IBM db2 database but I need to automate the process with java.
目前,我正在IBM db2数据库中的sql developer中手动执行此操作,但是我需要使用Java来自动执行该过程。 So for that I need to run the declare block using jdbc.
因此,我需要使用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?? 有人可以帮我通过jdbc调用此块吗?
您应该在db2中创建一个过程,然后使用db2驱动程序可以执行此过程
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.