I have a mysql stored procedure.
DELIMITER //
CREATE PROCEDURE GetRecordsByAge(IN Age INT)
BEGIN
SELECT * FROM test1 WHERE age = Age;
END //
DELIMITER ;
When I run this stored procedure through java then it is giving all records of the table.
But if I have a condition in select statement. Why this is happening?
here is set of lines of my code:-
CallableStatement cStmt = null;
cStmt = con.prepareCall("{ CALL GetSpecificRecord(?) }");
cStmt.setInt(1, 25);
cStmt.execute();
ResultSet rs1 = cStmt.getResultSet();
When I print this result set this will give all records of the table.
Where is the problem?
Thanks