private void generate() throws GeneratorException {
		
		
		int count = Integer.parseInt(props.getProperty("database.count", "0"));
		for (int dbDef = 1; dbDef <= count; dbDef++) {
			String server = props.getProperty("database." + dbDef + ".server");
			String schema = props.getProperty("database." + dbDef + ".schema");
			String type = props.getProperty("database." + dbDef + ".type");
			String user = props.getProperty("database." + dbDef + ".user");
			String password = props.getProperty("database." + dbDef + ".password");
			String outPath = props.getProperty("database." + dbDef + ".output");
			if (server == null || schema == null || type == null || user == null || password == null || outPath == null) {
				throw new GeneratorException("invalid generator.properties");
			}
			
			//resrouce creator 
			ResourceInfoReader rc = getResourceInfoReader(type);
			rc.initialize(server, schema, user, password);

			Collection<String> tables = rc.getTables();
			for (String table : tables) {
				String content = new String(template);
				content = content.replaceAll("%%QUERY%%", rc.getResourceQuery(table));
				content = content.replaceAll("%%TABLE%%", table);
				content = content.replaceAll("%%DB%%", schema);
				writeResource(content, table, outPath);
			}
			
		}
		
	}