@Override
	public boolean add(int prenodeid,Object item) {
		conn = SQLconnect.getConnection();
		if(item instanceof Worldnode)
		{
			Worldnode newitem = (Worldnode) item;
			ResultSet res;
			int newid = 0;
			String sql = "INSERT INTO `worlds` (`name`, `creator`, `creattime`, `display`,`time_headnode`) VALUES ('%s', '%s', '%s', 'true',0);";
			try {  
	            sql = String.format(sql,newitem.getName(),newitem.getCreator(),newitem.getCreattime());
	            Statement st = (Statement) conn.createStatement();    // 创建用于执行静态sql语句的Statement对象  
	            System.out.println(sql);
	            int count = st.executeUpdate(sql,Statement.RETURN_GENERATED_KEYS);  // 执行插入操作的sql语句，并返回插入数据的个数  
	            if(count > 0) {//记录保存成功  
	                res=st.getGeneratedKeys();  
	                if(res.next())  
	                	newid =res.getInt(1);  
	            
	            }  
	            System.out.println("newid " + newid);
	            System.out.println("insert " + count + " entries" + " newid" + newid); //输出插入操作的处理结果  */
	            conn.close();   //关闭数据库连接  
	            int headnode = new TimeNodeFactory().initTimenode(newid);
	            newitem.setTime_headnode(headnode);
	            newitem.setId(newid);
	            update(newitem);
	            return true;
	        } catch (SQLException e) {  
	            System.out.println("插入数据失败 " + e.getMessage());  
	            return false;
	        }
		}
		return false;
	}