I recently used SSH configuration, but since the Hibernate Code involves a large range of code, it is not my hope to manually write the Hibernate code file of 38 data tables, so we have this article. Prepare to add the environment variable Ant: Ant_HOME = D: \ Program Files (x86) \ apache-ant-1.9.3 path = % Ant_HOME % \ bin configuration: 1. first open the Middlegen-Hibernate-r5 \ config \ database \ * here there are all the xml files connected to the database I use mysql5.1, so I chose mysql. in xml, where the pink flag is edited, edit the value copy code. <! -- ===================================================== ============================================= --> <! -- Ant properties/targets for mysql --> <! -- Note: this is not a proper xml file (there is no root element) --> <! -- It is intended to be imported from a * real * xml file --> <! -- ===================================================== ========================================= --> <Property name = "database. script. file "value =" $ {src. dir}/SQL/$ {name}-mysql. SQL "/> <property name =" database. driver. file "value =" $ {lib. dir}/mysql-connector-java-5.1.28-bin.jar "/> <property name =" database. driver. classpath "value =" $ {database. driver. file} "/> <property name =" database. driver "value =" org. gjt. mm. mysql. driver "/> <prope Rty name = "database. url "value =" jdbc: mysql: // localhost/uel "/> <property name =" database. userid "value =" root "/> <property name =" database. password "value =" password "/> <property name =" database. schema "value =" "/> <property name =" database. catalog "value =" "/> <property name =" jboss. datasource. mapping "value =" mySQL "/> copy code I'm using here the mysql-connector-java-5.1.28-bin.jar needs to copy the mysql-connector-java-5.1.28-bin.jar to Middl Egen-Hibernate-r5 \ lib directory and then go to the directory Middlegen-Hibernate-r5 root directory edit build. xml file find the following code to change the database connection file to what you need, I use mysql. xml here <! DOCTYPE project [<! ENTITY database SYSTEM "file :. /config/database/mysql. xml ">]> then find the following code to copy the Code