When we use ActiveRecord, we can use:
User.find(:first, :conditions=>["name=?", name])
It looks like ActiveRecord are using 'prepared statement', but after looking into the code, I found ActiveRecord just use String.dup
and connection.quote()
to adjust the content to build a sql, not like Java.
So, there is no real prepared statment
in raiils? And why rails doesn't provide it?