简体   繁体   中英

Way to visualize schemacrawler output in web application

Can anybody suggest a good way to visualize schemacrawler output in a webapplication. I need the output as ER diragram. is there any good javascript or jquery plugin which uses DOT format? One more thing when i try to get the output in the dot format it is giving the output as

System Information

SchemaCrawler Information -=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-

product name SchemaCrawler
product version 12.04.02

Database Information -=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-

database product name MySQL
database product version 5.6.19-0ubuntu0.14.04.1
database user name demo@localhost

JDBC Driver Information -=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-

driver name MySQL Connector Java
driver version mysql-connector-java-5.1.34 ( Revision: jess.balint@oracle.com-20141014163213-wqbwpf1ok2kvo1om ) driver class name com.mysql.jdbc.Driver
url jdbc:mysql://localhost:3306/demodb is JDBC compliant false

Tables

demodb.dbconnection

                                                             [table]

id INT NOT NULL
auto-incremented
dbmsType VARCHAR(100)
ipAddress VARCHAR(100)
port VARCHAR(10)
username VARCHAR(100)
This table is used to store database connections password VARCHAR(100)
databaseName VARCHAR(100)

                                                       [primary key]

id ascending
auto-incremented

demodb.roles

                                                             [table]

roleId INT NOT NULL
roleName VARCHAR(45) NOT NULL

                                                       [primary key]

roleId ascending

demodb.userdetails

                                                             [table]

id INT NOT NULL
auto-incremented
name VARCHAR(45)
dob DATE
sex VARCHAR(1)
bloodgroup VARCHAR(5)
address VARCHAR(45)
place VARCHAR(45)
city VARCHAR(45)
state VARCHAR(45)
country VARCHAR(45)
zipcode VARCHAR(45)
mobile VARCHAR(45)
email VARCHAR(45)
occupation VARCHAR(45)

                                                       [primary key]

id ascending
auto-incremented

                                       [foreign key, with no action]

id <-- demodb. user .userDetailsId

demodb.userroles

                                                             [table]

id INT NOT NULL
auto-incremented
username VARCHAR(45) NOT NULL
roleName VARCHAR(45) NOT NULL

                                                       [primary key]

id ascending
auto-incremented

demodb. user

                                                             [table]

username VARCHAR(100) NOT NULL
password VARCHAR(300) NOT NULL
userDetailsId INT NOT NULL
active INT NOT NULL

                                                       [primary key]

username ascending

                                       [foreign key, with no action]

userDetailsId --> demodb.userdetails.id

                                                  [non-unique index]

userDetailsId ascending

                                                      [unique index]

username ascending

and my schemacrawler-context.xml is like

<bean id="outputOptions" class="schemacrawler.tools.options.OutputOptions">
    <property name="outputFormatValue" value="DOT" />
    <!-- <property name="outputFile" value="scOutput.txt" /> --><!-- This should be given(writer not file) given from the program. -->
</bean>

it is not working for DOT as well as dot

Khader,

For web output, you have a few output options available out of the box from SchemaCrawler. One option is to generate output in "htmlx" format, which will give you an ER diagram embedded in HTML, in a single file. Another option is to use "png" format to generate a PNG file. It is hard to see what executable you have in the Spring context, since you have not included this key information in your question. I would advise you to use the GraphExecutable.

Please note that in order to generate the ER diagram, you will need GraphViz installed on the web server. GraphViz will always generate a file, and cannot use a Java writer. So, please use the most appropriate constructor for OutputOptions .

If you like, you can have SchemaCrawler generate DOT format. Again, please use the most appropriate constructor for OutputOptions . You do not need GraphViz for this. You can use viz.js to visualize the DOT file using JavaScript.

Hope this helps.

Sualeh Fatehi, SchemaCrawler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM