>>>>>>>#和$的区别?<<<<<<<<<

1. #: Underlying equivalent preparedStatement, support? Placeholder, and $ equivalent to using Statement, do not support placeholders, all the parameters are assembled.

2. We recommend using #, but must be used in some cases $:

(1) Select * from xxs where name like '$ {n}' // like itself '' to be used when there $

(2) Select * from $ {tablename} // the name of the table to be used is dynamic $

(3)Select * from xxx where .. order by ${name}

Guess you like

Origin www.cnblogs.com/wanjijie10251616/p/11366337.html