偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

iBATIS SQLMap API編程淺析

開發(fā) 后端
iBATIS SQLMap API編程向你講述在iBATIS應用中如何使用SQLMap API編程的信息源代碼。那么這也是學習iBATIS SQLMap的一個好的機會。

iBATIS SQLMap API編程如何進行呢?首先我們配置好sqlmap-config.xml文件以后,需要對他進行解析,例如:

iBATIS SQLMap的Java代碼

  1. public void insert(Person p){     
  2.     String xml = "com/Jdnis/ibatis/map/sql-map-config.xml";     
  3.     SqlMapClient sqlMap = null;     
  4.     try {     
  5.         Reader reader = Resources.getResourceAsReader(xml);     
  6.         sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);     
  7.         sqlMap.startTransaction();     
  8.         sqlMap.insert("insertPerson",p);     
  9.         sqlMap.commitTransaction();     
  10.         System.out.println("數(shù)據(jù)插入成功");     
  11.     } catch (IOException e) {     
  12.         // TODO Auto-generated catch block     
  13.         e.printStackTrace();     
  14.     } catch (SQLException e) {     
  15.         // TODO Auto-generated catch block     
  16.         System.out.println("主鍵 "+p.getId()+" 沖突!無法插入數(shù)據(jù)");     
  17.     }finally{     
  18.         try {     
  19.             sqlMap.endTransaction();     
  20.         } catch (SQLException e) {     
  21.             // TODO Auto-generated catch block     
  22.             e.printStackTrace();     
  23.         }     
  24.     }     
  25. }   

iBATIS SQLMap API編程批處理:

Java代碼

  1. sqlMap.startBatch();     
  2. //...execute statements in between     
  3. sqlMap.executeBatch();   

iBATIS SQLMap API編程就講解到這里,希望對你有所幫助。

【編輯推薦】

  1. iBATIS SQLMap配置Demo淺析
  2. iBATIS入門程序六大步詳解
  3. iBATIS DAO事務淺析
  4. iBATIS使用$和#的一些理解
  5. iBATIS分頁的一些理解
責任編輯:仲衡 來源: JavaEye
相關推薦

2009-07-22 15:01:01

iBATIS SQLM

2009-07-22 09:07:01

iBATIS.NET

2009-07-21 11:12:00

iBATIS配置

2009-07-22 10:42:59

iBATIS Cach

2009-07-15 17:58:07

iBATIS 動態(tài)映射

2009-07-16 10:23:30

iBATIS工作原理

2009-07-16 09:14:26

iBATIS DAO

2009-07-15 17:19:31

iBATIS Ecli

2009-07-17 10:32:45

iBATIS MapB

2009-07-22 10:03:11

iBATIS Resu

2009-07-20 18:00:16

iBATIS DAO事

2009-07-17 10:59:59

iBATIS接口

2009-07-22 16:02:14

iBATIS參數(shù)

2009-07-17 09:44:40

iBATIS教程

2009-07-16 13:08:09

iBATIS快速創(chuàng)建應

2009-07-15 16:42:03

iBATIS讀寫CLO

2009-07-17 17:05:44

iBATIS緩存cacheModel

2009-07-22 09:44:05

iBATIS Para

2009-07-22 13:04:41

iBATIS動態(tài)查詢

2009-07-15 17:01:29

iBATIS操作CLO
點贊
收藏

51CTO技術棧公眾號