Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: Can a stored procedure invoke a Java program?

I have a MySQL stored procedure. I would like to have a stored procedure run some statements, then call a Java program. Then when the java program is complete, the stored procedure should finish.

The java program will connect to the database, do some analysis and then insert rows into other tables.

Is this possible?

like image 311
stackoverflow Avatar asked Apr 23 '26 15:04

stackoverflow


1 Answers

Yes. Take a look at The MySQL UDF Repository and the sys_exec function. You could use this to launch your Java code in a new JVM.

After you get that installed here is how you run it: https://dba.stackexchange.com/a/39547/14506

like image 167
Jim Garrison Avatar answered Apr 26 '26 08:04

Jim Garrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!