String call(String funname,HashMap<Integer,Object> params);
如:
mysql存储方法:
DROP FUNCTION `myfun` ;
CREATE DEFINER = `root`@`localhost` FUNCTION `myfun` (
`a` INT,
`b` INT
) RETURNS INT( 11 ) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER BEGIN #Routine
body goes here...
RETURN a + b;
END
java调用:
HashMap<Integer,Object> params=new
HashMap<Integer,Object>();
params.put(1,79);
params.put(2,858);
String a=m.call("myfun(?,?)",params);