Connection   conn   =   connPool.getConnection();   
                  try   {   
                        String   sql   =   "insert   into   yy_buyGood   (companyBID,buyDate,realDate,flag)"+   
                                                  "   values(?,?,?,?)";   
                          PreparedStatement   stmt   =   conn.prepareStatement(sql);   
                          stmt.setInt(1,companyBID);   
                          stmt.setDate(2,buyDate);   
                          stmt.setTimestamp(3,realDate);   
                          stmt.setString(4,flag);   
                          stmt.executeUpdate();   
                          sql   =   "select   @@IDENTITY   as   'justID'";   
                          stmt   =   conn.prepareStatement(sql);   
                          ResultSet   rs   =   stmt.executeQuery();   
                          if(rs.next()){   
                                  buyGoodID   =   rs.getInt("justID");   
    
                                  System.out.print(">>>>>>"+buyGoodID);//调试,显示为0,奇怪啊!   
                          }   
                          conn.close();   
                  }   catch   (SQLException   e)   {   
                          e.printStackTrace();     
                  }
这个为什么取不到新插入的int值