freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

ibatis教程中文版(已改無錯字)

2022-12-16 05:26:02 本頁面
  

【正文】 name= value=root/ /dataSource /transactionManager sqlMap resource=/ /sqlMapConfig iBatis 更新查詢 在我們的例子中 ,我們通過參數(shù)中指定的 id 更新了表中的數(shù)據(jù) ,因此對于 id我們將 parameterClass的屬性值分配為 long. ?xml version= encoding=UTF8? !DOCTYPE sqlMap PUBLIC // sqlMap namespace=Contact ! Showing all data of table select id=getAll resultClass=Contact select * from contact /select ! Update data of Contact table update id=updateById parameterClass=long update Contact set lastName = 39。Raghuwanshi39。 where id=id /update /sqlMap 現(xiàn)在我們可以在 Java 程序中通過如下代碼執(zhí)行更新操作了 : (,contactId)。 代碼如下 : import 。 import 。 import 。 import .*。 import 。 import .*。 public class IbatisUpdate{ public static void main(String[] args) throws IOException,SQLException{ Reader reader = ( )。 SqlMapClient sqlMap = (reader)。 //Updating one record of contact (* Updating informations of Contact *)。 Contact contct=new Contact()。 long contactId=1。 (,contactId)。 (|Updated Record Successfully )。 (All Contacts)。 ListContact contacts = (ListContact) (,null)。 Contact contact = null。 for (Contact c : contacts) { ( + ())。 ( + ())。 ( + ())。 ( + ())。 contact = c。 ()。 } (============================================)。 } } 為了執(zhí)行 update 的例子 ,遵照如下步驟 : 創(chuàng)建 和 編譯 創(chuàng)建 創(chuàng)建 并將其編譯 執(zhí)行 IbatisUpdate 類文件 ,你會得到如下輸出 : ResultMap 例子 如果你使用 iBatis的 Result Map來工作 ,那么 你一定知道 iBatis的 Result Map是用來提供 數(shù)據(jù)庫查詢結(jié)果和 它的對象屬性之間的映射的 ,這是 iBatis 最常見且重要的特性了 .本章 僅 是一個 ResultMap 的 簡單 介紹 .我們的 and 文件和我們的上一個例子是一樣的 ,沒有任何變化 . Contact POJO 的代碼如下 : public class Contact { private String firstName。 private String lastName。 private String 。 private int id。 public Contact() {} public Contact( String firstName, String lastName, String ) { = firstName。 = lastName。 = 。 } public String getEmail() { return 。 } public void setEmail(String ) { = 。 } public String getFirstName() { return firstName。 } public void setFirstName(String firstName) { = firstName。 } public int getId() { return id。 } public void setId(int id) { = id。 } public String getLastName() { return lastName。 } public void setLastName(String lastName) { = lastName。 } } ?xml version= encoding=UTF8? !DOCTYPE sqlMapConfig PUBLIC // sqlMapConfig settings useStatementNamespaces=true/ transactionManager type=JDBC dataSource type=SIMPLE property name= value=/ property name= value=jdbc: property name= value=root/ property name= value=root/ /dataSource /transactionManager sqlMap resource=/ /sqlMapConfig 要想使用 ResultMap 我們得使用 resultMap/resultMap標簽 .它由一個 id組成 ,該 id 需要在 select標簽下的 resultMap 屬性中運行 的代碼 ?xml version= encoding=UTF8? !DOCTYPE sqlMap PUBLIC // sqlMap namespace=Contact ! Showing data by ID resultMap id=result class=Contact result property=id column=id/ result property=firstName column=firstName/ result property=lastName column=lastName/ result property= column=/ /resultMap select id=getById resultMap=result select * f
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1