In this section, we will run schemaExport.jsp
on the WildFly application server to export the schema to the MySQL database. To accomplish this, perform the following steps:
http://localhost:8080/jboss-hibernate/schemaExport.jsp
in a browser, as shown in the following screenshot. The schema gets exported to the MySQL database.schemaExport.jsp
on the server is shown in the following code:10:57:23,589 INFO [org.hibernate.cfg.Configuration] (default task-8) HHH000041: Configured SessionFactory: HibernateSessionFactory 10:57:23,590 INFO [org.hibernate.dialect.Dialect] (default task-8) HHH000400: U sing dialect: org.hibernate.dialect.MySQL5InnoDBDialect 10:57:23,592 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (default task-8) HH H000227: Running hbm2ddl schema export 10:57:23,761 WARN [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000402: Using Hibernate built-in con nection pool (not for production use!) 10:57:23,841 INFO [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000401: using driver [com.mysql.jdbc .Driver] at URL [jdbc:mysql://localhost:3306/test] 10:57:23,842 INFO [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000046: Connection properties: {user =root, password=****} 10:57:23,843 INFO [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000006: Autocommit mode: false 10:57:23,843 INFO [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000115: Hibernate connection pool si ze: 20 (min=1) 10:57:24,035 INFO [stdout] (default task-8) 10:57:24,036 INFO [stdout] (default task-8) drop table if exists CATALOG 10:57:24,038 INFO [stdout] (default task-8) 10:57:24,038 INFO [stdout] (default task-8) create table CATALOG ( 10:57:24,038 INFO [stdout] (default task-8) ID integer not null auto_in crement, 10:57:24,039 INFO [stdout] (default task-8) JOURNAL varchar(255), 10:57:24,039 INFO [stdout] (default task-8) PUBLISHER varchar(255), 10:57:24,039 INFO [stdout] (default task-8) EDITION varchar(255), 10:57:24,039 INFO [stdout] (default task-8) TITLE varchar(255), 10:57:24,039 INFO [stdout] (default task-8) AUTHOR varchar(255), 10:57:24,040 INFO [stdout] (default task-8) primary key (ID) 10:57:24,040 INFO [stdout] (default task-8) ) ENGINE=InnoDB 10:57:27,224 INFO [org.hibernate.engine.jdbc.connections.internal.DriverManager ConnectionProviderImpl] (default task-8) HHH000030: Cleaning up connection pool [jdbc:mysql://localhost:3306/test] 10:57:27,225 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (default task-8) HHH000230: Schema export complete
DESC CATALOG
command in the MySQL command line for the structure of the CATALOG
table, as shown in the following screenshot: