update query is returning 1
but the insert query is returning None
.
def que3(params) {
DB.withConnection { implicit c =>
val i=SQL("UPDATE QUERY").executeUpdate
val j=SQL("INSERT QUERY").executeInsert
val k=SQL("INSERT QUERY").executeInsert
println(i)//1
println(j)//None
println(k)//None
}
}
I want to make sure that those query is do their job or not ? how could I get this.
Or should I go for three method with try catch block?
I am using scala 2.10 with play framework 2.2
You can use executeUpdate
as executeInsert
is the same thing but returns generated id's (auto inc fields etc) if you need them. It's using the same JDBC call for both of them.