ITeye博客

我自己的数据对象处理类 UpdateDemo

phantom · 2007-03-03 06:20 · 数据库处理 · Markdown

package com.jh.core.db.jdbc.demo;

import com.jh.core.db.TagDAO;

public class UpdateDemo {

 /**
  * @param args
  * @throws Exception
  */
 public static void main(String[] args) throws Exception {
  
  TagDAO<DemoBean> dao=new TagDAO<DemoBean>( DemoBean.class);
  DemoBean demo=dao.getObj("select * from DemoBean_tab where id=7 ");
  
  System.out.println("name ="+demo.getName());
  demo.setMemo("我是中国人");
  demo.setName("测试bean");
  demo.setType(9);

  
  TagDAO.updateObj(demo.getTableName(),new String[] {"memo","type"},new String[]{"id"}, demo);

 }

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。