JDBC Call Stored Procedure

preview_player
Показать описание

setString is a method to set the first parameter to String
Рекомендации по теме
Комментарии
Автор

call 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

avillanueva