Generating SQL for project
Select Tools > Object-Relational Mapping (ORM) > Generate Database... from the main menu.

|
Generate database
|
The Database Code Generation dialog box provides several options to generate DDL and export to database.

|
Database Code Generation dialog box
|
- Generate Database:
- Create Database - generate create statements only.
- Update Database - query existing object in database, generate create and alter statement depends on object not exists or outdated in database, or do nothing if database is up-to-date.
- Drop and Create Database - generate drop statements first, then generate create statements.
- Drop Database - generate drop statements only.
- Export to database - execute the generated statements directly to database.
- Generate DDL - save the generated statements to a file.
- Generate Comment - generate comment of tables/columns to database/DDL (only available to My SQL, DB2, Oracle, Postgre SQL)
- Upper Case SQL - generate upper case for keyword (e.g. select, from, update, insert...etc).
- Formatted SQL - generate pretty format, high readability SQL.
- Quote SQL Identifier - if database object name is reserved word, it must be quoted; otherwise, it cannot be used as the object name:
- Auto - auto detect and quote the name only if it is reserved word.
- Yes - always quote the name.
- No - never quote the name.
- Table Charset (Only available for MySQL) - the charset used for database connection.
- Connection:
 |
| Connection |
- JDBC - a standard way to connect database in Java.
- Datasource - the database connection is managed by application server.