簡體   English   中英

PSQLException:列索引超出范圍:2,列數:1

[英]PSQLException: The column index is out of range: 2, number of columns: 1

嘗試使用提供的電子郵件,密碼查詢電子郵件列表時發生以下錯誤。 實際上, subscribers_table有10列,列名為emailpassword

[PSQLException: The column index is out of range: 2, number of columns: 1.]

我的LoginProcess模型代碼:

    case class LoginProcess(email:String,password:String)

    //error occured in this line
    implicit val getLoginProcessResult = GetResult(r => LoginProcess(r.nextString, r.nextString))

    def check_Login_Success_Query(email: String,password:String) = sql"select email from provisions_schema.subscribers_table where email = $email and password=$password ".as[LoginProcess]

    val login_Success_Query_List = check_Login_Success_Query(email_ip,password_ip).list

    println("login_Success_Query_List.length ->" +login_Success_Query_List.length)

你做這個:

select email from provisions_schema.subscribers_table

該模型需要emailpassword 將密碼添加到您的查詢中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM