필수 Java API는 데이터베이스 ER 다이어그램을 생성합니다
-
09-12-2019 - |
문제
Java Connection 객체가 입력으로 제공 될 때 데이터베이스 ER 다이어그램을 생성 할 수있는 Java API / Java 플러그인이 있습니까?
ex : InputSream generateDatabaseERDiagram(java connection object)// where inputsream will point to generated ER diagram image
API는 Oracle, MySQL, PostgreSQL과 함께 작동해야합니까?
Schemacrawler (http://schemacrawler.sourceforge.net/) 도구를 통해 가고 있었지만 이렇게 할 수있는 API가 있습니다.
이런 API가 없으면 내 자신의 API를 어떻게 작성할 수 있는지 알려주지 않습니까?나는 스키마 이름이 입력으로 제공되는 경우 데이터베이스 또는 특정 스키마의 모든 스키마에 대한 ER 다이어그램을 생성하고 싶습니다.
이 작업을 수행하는 방법에 대해 조명을 보여 주면 도움이 될 것입니다.
다른 팁
이것은 오래된 질문이지만 다른 사람이 Schemacrawler의 Java API를 사용하여 ERD를 생성하는 방법을 궁극적으로 생성하는 것처럼 똑같은 일을하려고 할 때 마찬가지로 누군가가 시도하는 것처럼 무너지는 경우에 발생합니다.
//Get your java connection however
Connection conn = DriverManager.getConnection("DATABASE URL");
SchemaCrawlerOptions options = new SchemaCrawlerOptions();
// Set what details are required in the schema - this affects the
// time taken to crawl the schema
options.setSchemaInfoLevel(SchemaInfoLevelBuilder.standard());
// you can exclude/include objects using the options object e.g.
//options.setTableInclusionRule(new RegularExpressionExclusionRule(".*qrtz.*||.*databasechangelog.*"));
GraphExecutable ge = new GraphExecutable();
ge.setSchemaCrawlerOptions(options);
String outputFormatValue = GraphOutputFormat.png.getFormat();
OutputOptions outputOptions = new OutputOptions(outputFormatValue, new File("database.png").toPath());
ge.setOutputOptions(outputOptions);
ge.execute(conn);
.
이 여전히 Worchviz 가 필요합니다.
제휴하지 않습니다 StackOverflow