3

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?

5
  • Wait, so you just want to execute an external java application as part of a data insert? I'm confused as to how this is related to stored procedures. Commented Mar 19, 2012 at 20:38
  • i wish to do this call processData() and then do everything that I typed above Commented Mar 19, 2012 at 20:39
  • So, what have you tried? Stack Overflow really frowns on questions that don't show what the Asker has tried and where they ran into troubles. Commented Mar 19, 2012 at 20:43
  • @cdeszaq its a general question relating to a programmatic approach. I guess the stackoverflow people hate those kinds of questions. And thanks for downvoting Commented Mar 19, 2012 at 20:47
  • 1
    No, the community hates simply providing answers to people that don't show that they have at least attempted to find a solution on their own. I'm not saying that this is a bad question, just that you will likely get more answers if you have shown what you tried and what trouble you ran into. Commented Mar 19, 2012 at 20:49

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

can u please provide the information about the arguments taken by sys_exec function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.