public static void execute(String url, String user, String password, String schema, String table,
			String packageName, String folder, boolean annotateSchema, boolean trimStrings)
			throws SQLException {
		try {
			Db db;
			if (password == null) {
				db = Db.open(url, user, (String) null);
			} else {
				db = Db.open(url, user, password);
			}
			DbInspector inspector = new DbInspector(db);
			List<String> models = inspector.generateModel(schema, table, packageName, annotateSchema,
					trimStrings);
			File parentFile;
			if (StringUtils.isNullOrEmpty(folder)) {
				parentFile = new File(System.getProperty("user.dir"));
			} else {
				parentFile = new File(folder);
			}
			parentFile.mkdirs();
			Pattern p = Pattern.compile("class ([a-zA-Z0-9]+)");
			for (String model : models) {
				Matcher m = p.matcher(model);
				if (m.find()) {
					String className = m.group().substring("class".length()).trim();
					File classFile = new File(parentFile, className + ".java");
					Writer o = new FileWriter(classFile, false);
					PrintWriter writer = new PrintWriter(new BufferedWriter(o));
					writer.write(model);
					writer.close();
					System.out.println("Generated " + classFile.getAbsolutePath());
				}
			}
		} catch (IOException io) {
			throw new SQLException("could not generate model", io);
		}
	}