質問

Java接続オブジェクトが入力として提供されている場合は、データベース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/)ツールを経て行っていましたが、Didintはこれを行うことができるAPIを得ました。

このようなAPIがいない場合は、私に自分のAPIを書くことができる方法を教えてください。スキーマ名が入力として提供されている場合は、データベース内のすべてのスキーマまたは特定のスキーマのERダイアグラムを生成します。

この作業を達成する方法にいくつかの光を見せば役に立ちます。

役に立ちましたか?

解決

私が正しく質問した場合は、次の点をご質問してください。 jgraph

他のヒント

これは古い質問ですが、私が同じことをしようとしているときに私が同じことをしようとしているときに他の誰かがそれを渡ってつまずいたとき、私は最終的に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 がインストールされ、作業するパスに必要です。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top