[Lift] Re: How can i update and insert record into database via Raw sql in Lift?

2009-12-19 Thread Neil.Lv
Got it, thank you very much! :) Cheers, Neil On Dec 19, 11:02 pm, Marcin Jurczuk wrote: > Neil, > > from java.SQL: >  return INT - executeUpdate() >           Executes the SQL statement in this PreparedStatement object, > which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL

[Lift] Re: How can i update and insert record into database via Raw sql in Lift?

2009-12-19 Thread Marcin Jurczuk
Neil, from java.SQL: return INT - executeUpdate() Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement. return ResultSet executeQuery() Ex

[Lift] Re: How can i update and insert record into database via Raw sql in Lift?

2009-12-18 Thread Neil.Lv
It works now. I use the same executeUpdate method, and it can insert into the db. Thanks Marcin, Cheers, Neil On Dec 19, 1:29 am, "Neil.Lv" wrote: > Hi Marcin, > >    Thank you very much! The update statement works now! > >    There is a question about the insert statement, how can i use

[Lift] Re: How can i update and insert record into database via Raw sql in Lift?

2009-12-18 Thread Neil.Lv
Hi Marcin, Thank you very much! The update statement works now! There is a question about the insert statement, how can i use the prepareStatement ? ### "INSERT INTO blogs click_counts=100 WHERE id=1" ### I'm not familiar with it, Thanks very much! :) Cheers, Neil On Dec

[Lift] Re: How can i update and insert record into database via Raw sql in Lift?

2009-12-18 Thread Marcin Jurczuk
Hi, You have few options: - DB.runQuery("UPDATE blogs set click_counts=click_counts+1 WHERE id=1") - DBprepareStatement("UPDATE blogs set click_counts=click_counts+1 WHERE id=?",yourDBConnection) { stmt => stmt.setLong(1,1) stmt.executeUpdate() } Where first 1 in setLong is position in prepared st