企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 组件源码 /** * <b>方法描述:</b> 关闭连接 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-08 17:33:14 <br/> * * @param poolName * 入参|数据源,为空使用默认|{@link java.lang.String} * @return -1 异常<br/> * 0 失败<br/> * 1 成功<br/> */ @Component(label = "关闭连接", style = "判断型", type = "同步组件", comment = "关闭连接", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-08 05:33:14") @InParams(param = { @Param(name = "poolName", comment = "数据源,为空使用默认", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase P_closeConnection(String poolName) { try { if (JdbcUtil.closeConnection(poolName)) { return ResultBase.newSuccessResult(); } else { return ResultBase.newFailureResult("TPTJ0005", "关闭连接 失败"); } } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTJ0006", "关闭连接 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/f9/3b/f93bf852ede247f9e91643dc27059229_1321x1174.png) 数据源的来源为项目的配置文件中的数据源,以及前端页面上的数据源管理列表中添加的数据源