Input
Output
import java.sql.*; public class CallableStatementExample { public static void main(String[] args) { try { Class.forName("com.mysql.cj.jdbc.Driver"); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/testdb", "root", "password"); // Prepare call CallableStatement cs = con.prepareCall("{call getEmployee(?)}"); // Set IN parameter cs.setInt(1, 101); // Execute ResultSet rs = cs.executeQuery(); // Process results while (rs.next()) { System.out.println(rs.getInt("id") + " - " + rs.getString("name")); } cs.close(); con.close(); } catch (Exception e) { e.printStackTrace(); } } }