我试图通过我的程序登录我们的数据库,但是当我这样做时,我得到无效的凭证,所以我不知道从哪里开始希望任何人都可以帮助我,因为我之前没有使用过pwdencryp和pwdcompare而且我不是确定如何让它发挥作用
我的代码:
protected String doInBackground(String... params) {
if (userid.trim().equals("Developer")|| password.trim().equals("Dev!n_234"))
isSuccess2=true;
z = getString(R.string.login_succes);
if(userid.trim().equals("")|| password.trim().equals(""))
z = getString(R.string.indsæt_rigtigt_bruger);
else
{
try {
Connection con = connectionClass.CONN();
if (con == null) {
z = getString(R.string.Forbindelses_fejl)+"L1)";
} else {
CallableStatement cs = null;
String query = "{call [system].[usp_validateUserLogin] (?,?,?,?,?)}";
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
CallableStatement ps = con.prepareCall(query);
ps.setString(1, userid);
ps.setString(2, password);
ps.setInt(3,72);
ps.setNull(4, Types.BOOLEAN);
ps.registerOutParameter(5, Types.VARCHAR);
cs.executeUpdate();
if(rs.next())
{
z = getString(R.string.login_succes);
isSuccess=true;
}
else
{
z …Run Code Online (Sandbox Code Playgroud)