`
danielhjd
  • 浏览: 243277 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
public static void boxing(){ (1)Autoboxing 装箱 int i=9; Integer  o_i=new Integer (i); (2)Unboxing 拆箱 int j=o_i.intValue(); (3)利用list数组 List <Integer>list=new ArrayList<Integer>(); list.add(i); list.add(j); (4)在J2EE中直接可以调用o_i 而无需Unboxing 拆箱 list.add(o_i); Iterator<Integer ...
package j2ee; import java.util.ArrayList; import java.util.List;        public class ForEnhanced { (1)在没有用iterator的情况下,for-loop遍历:其中涉及到list.size()方法和list的get()方法         public static void iteratorAarrayByFor(){ List <String> list = new ArrayList<String>(); list.add("How are yo ...
package j2ee; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class GenericsExample { public static void iteratorArray(){ List <String> list = new ArrayList<String>(); list.add(new String ("Testing Generics")); list.add(new String(" ...
public static Department getById(int department_id){        Connection con=DMmanager.getConnection();        PreparedStatement pst= null;        String str="select * from department where department_id =?";        pst=con.prepareStatement(str);        (1)因为此处有一展位符,所以????        pst.setInt(1 ...
public static void updateDep(int department_id,Float salary){     Connection con=DMmanager.getConnection();     PreparedStatement pst = null;     String str = "update department set salary=? where department_id=?"     pst = con.prepareStatement(str);         pst.getId(1,department_id);     ...
public static void insertDep(int department_id String department_name, float salary, int location_id){       (1)调用JDBC的环境构架         Connection con=DMmanager.getConnection();        PreparedStatement pst=null;        String str="insert into department values(?,?,?,?)";        pst = con.prep ...
public static List getAllDepartment(){     (1)创建List类的对象list,用来实现其Add方法     List list = new Arraylist();     (2)调用构建好的SQL和JAVA运行环境,并创建ResultSet类的对象rs来存储缓存表格        Connection con=DMmanager.getConnection();     PreparedStatement pst= null;     String str = "select * from department";     Re ...
import java.util.*; public class Visitor{   public static void print(Collection c){     Iterator it=c.iterator();     //遍历集合中的所有元素     while(it.hasNext()){       Object element=it.next();  //取出集合中的一个元素       System.out.println(element);      }   }   public static void main(String args[]){     Set< ...
触发器 是特定事件出现的时候,自动执行的代码块。类似于存储过程,但是用户不能直接调用他们。 功能: 1、 允许/限制对表的修改 2、 自动生成派生列,比如自增字段 3、 强制数据一致性 4、 提供审计和日志记录 5、 防止无效的事务处理 6、 启用复杂的业务逻辑 Instance: create trigger biufer_employees_department_id before insert or update of department_id on employees referencing      old as old_value      new as new_ ...
  <SCRIPT LANGUAGE="JavaScript"> <!-- function People(h){ //类里面的变量 this.height = h; //对象里的函数 this.max =function(a,b){ var c = a>b?a:b; return c; } this.say=function(){ alert("saying!"); } this.max=function(a,b,c){ var m=this.max(a,b); var n=this.max(m ...
Global site tag (gtag.js) - Google Analytics