3

提供された電子メール、パスワードを使用して電子メールのリストを照会しようとすると、次のエラーが発生しました。実際、subscribers_tableには、列名がemailpasswordの 10 個の列があります。

[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)
4

1 に答える 1

4

これをして:

select email from provisions_schema.subscribers_table

そして、モデルは と を期待emailpasswordます。クエリにパスワードを追加する

于 2013-10-10T07:24:51.467 に答える