1

Java接続オブジェクトが入力として提供されたときにデータベースER図を生成できるJava API / Javaプラグインはありますか?

元:InputSream generateDatabaseERDiagram(java connection object)// where inputsream will point to generated ER diagram image

API は oracle、mysql、postgresql で動作する必要がありますか?

私は schemacrawler(http://schemarawler.sourceforge.net/) ツールを使用していましたが、これを実行できる API はありませんでした。

このような API がない場合、独自の API を作成する方法を教えてください。スキーマ名が入力として提供されている場合、データベース内のすべてのスキーマまたは特定のスキーマの ER 図を生成したいと考えています。

このタスクを達成する方法を明らかにしていただけると助かります。

4

2 に答える 2

2

私があなたの質問を正しく理解したなら、あなたは見てみるかもしれません:JGraph

于 2012-03-08T09:07:28.803 に答える
2

これは古い質問ですが、同じことをしようとしたときに他の誰かがそれに出くわした場合に備えて、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);

これには、graphvizがインストールされ、動作するパス上にあることが必要です。

于 2015-10-22T09:32:23.223 に答える