2

I want to execute the java code via he sys_exec in MySQL. I configured the sys_exec via the CREATE FUNCTION sys_exec RETURNS STRING SONAME 'lib_mysqludf_sys.dll'; When I run command SELECT sys_exec(" java HelloWorld ") FROM dual , this is not worked.

but it is works in window command line. C:\Program Files\MySQL\MySQL Server 5.5\data>java HelloWorld

hello

Also the system command is works fine as below. SELECT sys_exec(concat("dir"," /s > C:\out.txt") ) FROM dual works fine in mysql.

If I want to execube SELECT sys_exec( " java -cp .;mail.jar;mailapi-1.4.2.jar SendMailTest " ) FROM dual in mysql procedure; how can I do, what I missed when using this command? could you give an example for reference?

C:\Program Files\MySQL\MySQL Server 5.5\data>java -cp .;mail.jar;mailapi-1.4.2.jar SendMailTest is works in window command line too.

0 Answers0