int i=0
vector.addElement(i);
为什么不行呀

解决方案 »

  1.   


    1.用Hashtable,不过Hashtable只能存Object对象,而不是基本数据类型.
    java.util.Hashtable ht = new java.util.Hashtable();
    ht.put("dataA",new Integer(12345));
    ht.put("dataB","I'm a boy.");
    ht.put("dataC",new Float(3.1415925));
    ht.put("dataD",new Date());2.
    stmt.execute("存储过程名称 参数1,参数2");
    stmt.execute("execute 存储过程名称 参数1,参数2");
    我也忘了是哪个,试试吧
      

  2.   

    2.        java.sql.CallableStatement cstmt;
            cstmt=con.prepareCall(asdfasdf)        
           cstmt.execute()
      

  3.   

    用VECTOR 来存储
     int i=0
      vector.addElement(i);
    改int i=0;
       vector.addElement(new Integer(i));
      

  4.   

    String sql="{ call spDeptInto (?) }";
    CallableStatement stmt = conn.prepareCall(sql);
    stmt.registerOutParameter(1, Types.VARCHAR);
    stmt.execute();
      

  5.   

    String sDept = stmt.getString(1);
      

  6.   

    问题1:ArrayList 就可以呀! 不过它只能存储Object的类型,但是Object是任何类的父类!
    不过从ArrayList取出数据时要向下转型的! 
    ArrayList my =new ArrayList();
    my.add(....);
    .......
    取数据: (int)my.get(i)  //向下转型 !
      

  7.   

    ArrayList my =new ArrayList();
    my.add(....);