The example of this article tells the way Java calls the MYSQL storage procedure and obtains the return value. Share it for everyone for your reference. The specifics are as follows:
Private Void Empsindept (Connection MyConnect, Int DEPTID) Throws Sqlexception {CallableStatement CSTMT = MyConnect.prepareCall ("{Call sp_emps_in_deptttttt (?)} "); CSTMT.Setint (1, DEPTID); CSTMT.EXECUTE (); ResultSet RS1 = CSTMT .getResultSet (); While (rs1.next ()) {system.out.println (RS1.getString ("department_name") + " + RS1.getString (" local ");} / / * Process Second Result Set */ if (cstmt.getmoreresults ()) {ResultSet RS2 = CSTMT.GetResultSet (); While (rs2.next ()) {System.out.println (RS2. getint (1) + "" + RS2.getString (2) + "" + RS2.getString (3));} RS2.Close ();} cstmt.close ();}It is hoped that this article is helpful to everyone's Java program design.