为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: dm7 dm8
【操作系统】: linux windows
【CPU】:
【问题描述】*:jdbc中执行存储过程时如果获得print打印的内容,
create or replace procedure PROC_PRINT
AS
begin
print ‘abc’;
end;
CALL PROC_PRINT;
jdbc调用时怎么获取 abc 日志内容
刚找到
Class.forName(“dm.jdbc.driver.DmDriver”);
try (Connection conn = DriverManager.getConnection(“jdbc:dm://localhost:5236”,“user”,“***”);
CallableStatement stmt = conn.prepareCall(“CALL PROC_PRINT;”)
){
stmt.execute();
DmdbStatement dmdbStatement = (DmdbStatement)stmt;
System.out.println(dmdbStatement.getPrintMsg());
System.out.println(dmdbStatement.getExecuteId());
}
写函数吧,你这种需求是要函数比较符合,毕竟函数可以返回值