如何限制多个电子邮件ID插入数据库?

时间:2019-03-26 16:11:32

标签: java mysql jsp servlets jdbc

当用户在我的页面上注册时,我只希望将唯一的电子邮件ID插入数据库。为此,我已经将我的emailid列设置为唯一。但是,我希望当用户尝试输入数据库中已经存在的电子邮件ID时,应将用户重定向到注册页面。

以下是我的代码,但没有用。

extension ViewController: WKNavigationDelegate {

func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
    let trust = challenge.protectionSpace.serverTrust!
    let exceptions = SecTrustCopyExceptions(trust)
    SecTrustSetExceptions(trust, exceptions)
        completionHandler(.useCredential, URLCredential(trust: trust))
    }

}

0 个答案:

没有答案