Can I call a stored procedure in jdbc which returns a table using mysql?
Asked Answered
T

1

2

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.

Tippet answered 23/6, 2016 at 21:7 Comment(0)
I
1

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

Examples provided here:

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

Inept answered 23/6, 2016 at 21:19 Comment(2)
It's also possible for a MySQL stored procedure to return multiple resultsets, and to iterate through the returned resultsets using JDBC.Inept
how is it possible? I tried it now but it only returns just one row of the table? how should I iterate?Tippet

© 2022 - 2024 — McMap. All rights reserved.