When to use $ vs #?

Following the myBatis guidelines #{} is used in your sql statements. If you take a look any of MyBatis Reference in the Section Mapper XML Files it says explicity: Notice the parameter notation: #{id} Otherwise ${} is for 1- Configuration properties. For example: <properties resource=”org/mybatis/example/config.properties”> <property name=”username” value=”dev_user”/> <property name=”password” value=”F2Fa3!33TYyg”/> </properties> Then the properties … Read more

How to use Annotations with iBatis (myBatis) for an IN query?

I believe the answer is the same as is given in this question. You can use myBatis Dynamic SQL in your annotations by doing the following: @Select({“<script>”, “SELECT *”, “FROM blog”, “WHERE id IN”, “<foreach item=’item’ index=’index’ collection=’list'”, “open='(‘ separator=”,” close=”)”>”, “#{item}”, “</foreach>”, “</script>”}) List<Blog> selectBlogs(@Param(“list”) int[] ids); The <script> element enables dynamic SQL parsing … Read more

Difference between ibatis and mybatis

MyBatis is a fork from iBATIS, and according to Wikipedia most of iBATIS’ developers moved over to MyBatis too. The iBATIS project is currently marked as Inactive, therefore you should go with MyBatis for new projects and only use iBATIS if you’re maintaining an existing project which already uses iBATIS. http://en.wikipedia.org/wiki/MyBatis MyBatis is a fork … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)