试图将用户数据插入数据库。检查所有参数,数据正确,但仍然抛出异常
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
代码是这样的
DB.withConnection {
implicit c =>
SQL( """"
insert into tUser (fname, lname, fullname, avatarurl, email, extuid, service)
values ({fname}, {lname}, {fullname}, {avatarurl}, {email}, {extuid}, {service})
""").on(
'fname -> socialUser.firstName,
'lname -> socialUser.lastName,
'fullname -> socialUser.fullName,
'avatarurl -> socialUser.avatarUrl.getOrElse(Option.empty),
'email -> socialUser.email.getOrElse(Option.empty),
'extuid -> socialUser.id.id,
'service -> socialUser.id.providerId
).executeUpdate()
}
尝试使用H2,现在我使用MySQL,但有同样的错误