String call = "{?= CALL Proc(?)}";
CallableStatement cs = conn.prepareCall(call);
cs.registerOutParameter(1, Types.DECIMAL, 0);
cs.setString(2, "String");
System.out.println(cs);
cs.execute(); // <-- ERROR
First line of simple MySQL procedure:
CREATE DEFINER=`dev`@`11.22.33.44` PROCEDURE `Proc`(IN `login` VARCHAR(255), OUT `var` DECIMAL(20,2)
.prepareCall turns my CALL into a SELECT (my guess) which mysql considers a Function and gives me a error:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION Proc does not exist
The System.out gives me:
com.mysql.jdbc.JDBC4CallableStatement@38d060ac: SELECT Proc('flavi')
How can I properly call this procedure?