Example usage for org.apache.ibatis.jdbc SqlRunner selectAll

List of usage examples for org.apache.ibatis.jdbc SqlRunner selectAll

Introduction

In this page you can find the example usage for org.apache.ibatis.jdbc SqlRunner selectAll.

Prototype

public List<Map<String, Object>> selectAll(String sql, Object... args) throws SQLException 

Source Link

Document

Executes a SELECT statement that returns multiple rows.

Usage

From source file:com.glaf.core.test.MyBatisJdbcRunnerTest.java

License:Apache License

@Test
public void testSelectMany() {
    Connection connection = null;
    SqlRunner runner = null;
    try {//from ww  w  .  j a va  2 s.co m
        connection = DBConnectionFactory.getConnection();
        runner = new SqlRunner(connection);
        Object[] args = { "SYS", "fs_%" };
        List<Map<String, Object>> dataList = runner
                .selectAll(" select * from SYS_PROPERTY where CATEGORY_ = ? and NAME_ like ? ", args);
        System.out.println(dataList);
    } catch (Exception ex) {
        ex.printStackTrace();
    } finally {
        JdbcUtils.close(connection);
    }
}