public void getCategoryDB() throws SQLException{
		DataSource ds = null;	
			
		try{
			Context ctx = new InitialContext();
			ds = (DataSource)ctx.lookup("java:comp/env/database-category");
			
			if(ds == null)
				throw new SQLException("Error, could not retrieve data source.");
			
			Connection con = ds.getConnection();
			
			if(con == null)
				throw new SQLException("Error, could not establish connection with database.");
			
			PreparedStatement ps = 
					con.prepareStatement("SELECT category_name, category_parent_node, isRoot FROM category_info");
			
			ResultSet rs = ps.executeQuery();
			
			while(rs.next()){
				if(rs.getBoolean("isRoot")){
					if(!search(rs))
						categoryInfo.add(new Categories(rs.getString("category_name")));
				}else{
					searchAndAdd(rs);
					 if(!found){
						 if(rs.getBoolean("isRoot")){
						 	categoryInfo.add(new Categories(rs.getString("category_parent_node")));
						 	categoryInfo.get(categoryInfo.size()-1)
									.addList(new Categories(rs.getString("category_name")));
						 }
					 }else
					 	found = false;
				}
					
			}
		}catch(NamingException e){
			e.printStackTrace();
		}
	}