SQL SERVER中建立的存储过程
CREATE PROCEDURE Select_U_N
@UserName varchar(20),
@PassWords Varchar(16)
AS
Declare @UserID INT
Select @UserID=UserID From UserInfo_Table
Where UserName= @UserName
And PassWords = @PassWords
If @UserID!=NULL
Return @UserID
Else
Return 0
GO
部分的JavaBean:
public ResultSet ProcedureSQL(){
try{
connect= DriverManager.getConnection(sConnstr);
CallableStatement stmt=connect.prepareCall("{call Select_U_N(?,?)}",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
stmt.setString(1,"ming");
stmt.setString(1,"ming");
rs=stmt.executeQuery();
}catch(SQLException SQLe){
System.err.println("发现有错误!\n");
}
return rs;
}
怎么回事?请大家指点,小第谢了!