import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.CallableStatement; import java.sql.Types; public class CallFuncQuote { public static void main(String[] args) { try { Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:13000", "root", null); CallableStatement cstmt = conn.prepareCall("{ CALL `test`.foo(?) }"); cstmt.registerOutParameter("outp", Types.LONGVARCHAR); cstmt.execute(); System.out.println("outp = " + cstmt.getString(1)); } catch (SQLException ex) { ex.printStackTrace(System.out); } } }