我可以在jdbc中调用存储过程,该存储过程使用mysql返回表吗?

问题描述:

我是刚开始使用jdbc执行mysql存储过程.我的问题是,可以调用存储过程来返回jdbc中的表吗?我进行了很多搜索,我知道可以使用 registerOutParameter 使用过程返回一定数量的参数,但是整个表有几行呢?!

I'm new to using jdbc to execute mysql stored procedures. My question is that is it possible to call an stored procedure which returns a table in jdbc? I searched a lot and I know I can return a certain number of parameters using registerOutParameter using procedures, but how about a whole table with several rows?!

我希望这不是多余的帖子.

I hope it's not a redundant post.

是.可以调用MySQL存储过程以使用JDBC返回结果集.

Yes. It's possible to call a MySQL stored procedure to return a resultset using JDBC.

此处提供示例:

https://docs.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html#calling_javadb_mysql