Is it possible for apache dbutils library to invoke oracle stored procedures?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes:
QueryRunner run = JDBCConnectionFactory.getQueryRunner(database);
Connection conn = run.getDataSource().getConnection();
CallableStatement cs = conn.prepareCall("{CALL procName()}");
ResultSet rs = cs.executeQuery();
JongoResultSetHandler handler = new JongoResultSetHandler(true);
return handler.handle(rs);
Here I use a QueryRunner instance to obtain its connection since this is managed by DBUtils. Take in mind closing connection, exception handling, etc.
Hope this helps.
回答2:
Yes as it just uses JDBC - you will need a JDBC driver for Oracle