JDBC Call Stored Procedure

Опубликовано: 10 Июнь 2026
на канале: A Villanueva
5,173
5

all dbo.usp_CheckUserPass(?,?,?)

the name of stored proc is dbo.usp_CheckUserPass
(?,?,?) represents the parameters of dbo.usp_CheckUserPass
cstmt.setString(1,username) - 1 represents the first parameter or question mark and username represents the value of the first parameter
setString is a method to set the first parameter to String
cstmt.registerOutParameter(3,java.sql.Types.VARCHAR); - represents the third parameter which is an OUTPUT parameter
java.sql.Types.VARCHAR represents the data type of the OUTPUT parameter
cstmt.execute(); - executes the statement
cstmt.getString(3) -getString is a method to get the String value of the OUTPUT parameter of a STORED PROCEDURE