public
class ProcedureTest {
????????
???????? public static void main(String[]
args) throws IOException {
???????? ??
String resource = "mybatis.cfg.xml";
? ? ? ? ? ??Reader reader =
Resources.getResourceAsReader(resource);
? ? ? ? ? ??SqlSessionFactory ssf = new
SqlSessionFactoryBuilder().build(reader);
???????
? ? ? ? ? ??SqlSession session =
ssf.openSession();
???????
? ? ? ? ? ?try {
??????? ? ? ? ? ?Map<String,
String> param = new HashMap<String, String>();
??????? ? ? ? ? ?param.put("p_user_name",
"zhangsan");
??????? ? ? ? ? ?String
returnValue = (String) session.selectOne("User.proHello", param);
??????? ? ? ? ? ?System.out.println("message="
+ param.get("p_user_name"));
??????? ? ? ? ? ?System.out.println("result="
+ param.get("result"));
??????? ? ? ? ? ?System.out.println("returnValue="
+ returnValue);
?
? ? ? ? ? ?} catch (Exception e) {
? ? ? ? ? ? ? ??e.printStackTrace();
? ? ? ? ? ?} finally {
? ? ? ? ? ? ??session.close();
? ? ? ? ??}
???????}
}
|