emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Documentation on SqlRunner #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
3.0.1

Please describe the problem.
In the My Batis 3 User Guide the classes SqlBuilder and SelectBuilder are 
mentioned. It is yet not explained how the SQL generated with this classes can 
be used. The user guide should be amended by a description of class SqlRunner.

Original issue reported on code.google.com by c...@team-pb.de on 21 Jul 2010 at 6:41

GoogleCodeExporter commented 9 years ago
Agreed.

Original comment by cowwoc...@gmail.com on 17 Jan 2011 at 1:27

GoogleCodeExporter commented 9 years ago
i have same problem!

Original comment by niksh...@gmail.com on 20 Jul 2011 at 12:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have the same problem!
http://groups.google.com/group/mybatis-user/browse_thread/thread/c80995b1b0ab91e
b

Original comment by y00109...@gmail.com on 8 Feb 2012 at 2:28

GoogleCodeExporter commented 9 years ago
package chapter6;

import java.util.Map;

import org.apache.ibatis.jdbc.SqlRunner;
import org.apache.ibatis.session.SqlSession;

public class RunSqlRunner extends MyBatisSupport {
    public static void main(String args[]) {
        String sql = "SELECT * FROM SHOP WHERE SHOP_NO" + " = ?";

        SqlSession sqlSession = getSqlSessionFactory().openSession();
        SqlRunner sqlRunner = new SqlRunner(sqlSession.getConnection());

        try {
            Map mapShop = sqlRunner.selectOne(sql, 1);
            System.out.println(mapShop);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            sqlRunner.closeConnection();
            sqlSession.close();
        }
    }
}

Original comment by plusper...@gmail.com on 13 Dec 2012 at 4:14