Use powerdesigner 16 to reversely generate a model from the database

This article is for mysql database

Ready to work:

1. A 32-bit java environment is required.

2. The data connection package mysql-connector-java-5.1.44-bin.jar is required.

Important: You need to set environment variables after installation, otherwise it will report Could not Initialize JavaVM! error.

Not to mention the system variables, the pd variable is set to click "Tools" --> "General Options" --> "Variable" The complete environment variables are as follows:

System variable

CLASSPATH = E:\Workspaces\my-jar\mysql-connector-java-5.1.7-bin.jar  
Path = D:\Java\jdk1.6.0_13\bin;  
JAVA_HOME = D:\Java\jdk1.6.0_13\;


PowerDesigner配置
PowerDesigner Tools --> General Options --> Variables:
JAR D:\Java\jdk1.6.0_13\bin\jar.exe  
JAVA D:\Java\jdk1.6.0_13\bin\java.exe  
JAVAC D:\Java\jdk1.6.0_13\bin\javac.exe  
JAVADOC D:\Java\jdk1.6.0_13\bin\javadoc.exe  

 

Steps:

1. First create a new "PhysicalDataModel" type file, then click "Database" -> "Configure Connections", a pop-up window "Configure Data Connections", and select "Connection Profiles" as shown below:

2. Click to create a new mysql connection, the following window appears, and fill in the relevant information

User name: database user name

JDBC driver:com.mysql.jdbc.Driver

JDBC URL: jdbc:mysql://ip:port

JDBC jar files: the location of the mysql connection package

 

3. Click "Test Connection" to test it. If it is unsuccessful, go back and check the environment variables.

4. After the connection is successful, click "Database" -> "Update Model from Database", and a pop-up window "Database Reverse Engineering Options" will appear, as shown in the figure below: 

5. Select the newly created data source, click OK, and enter the database account password

6. After connecting, select the database and table to export

Note: By default, all database tables are selected. You can click to make all the databases unselected, then click the drop-down box to filter out the libraries you want to export, and then click to select all the tables that have just been filtered.

7. Wait for automatic generation

8. At this point, the generation is complete.

 

Guess you like

Origin blog.csdn.net/qq_36961530/article/details/98869778