【问题标题】:Calling a stored procedure using apache DBUtils使用 apache DBUtils 调用存储过程
【发布时间】:2012-11-07 04:16:19
【问题描述】:

我找不到如何使用 DBUtils 调用可调用语句

我们可以指定哪些字段是输入,哪些是重新输出?

【问题讨论】:

  • 您可以在这里找到问题的答案:link
  • 可以用dbutils指定in和out参数吗?
  • DBUtils是一个封装Database Operator的轻量级jar,没有存储过程的功能,请使用Connection(CallableStatement)的JDBC Operator

标签: java callable-statement apache-commons-dbutils


【解决方案1】:

您只需要使用CallableStatement

Connection con = ...; // get the connection
CallableStatement callStatement = con.prepareCall("{CALL yourStoredProcedure()}");
ResultSet rs = callStatement.executeQuery();
// do what you need to do

【讨论】:

  • 这里我们没有使用 DButils
  • 可以用dbutils指定in和out参数吗?
猜你喜欢
  • 2012-02-03
  • 2016-08-06
  • 1970-01-01
  • 2013-12-10
  • 2011-12-11
  • 2017-10-02
  • 2014-08-07
  • 2011-08-04
  • 1970-01-01
相关资源
最近更新 更多