Database Tools in MyEclipse
1. Database Tools for Enterprise Applications
When developing Java enterprise applications, there is frequently a need to store and retrieve data from application and enterprise databases. MyEclipse's rich set of database and persistence features enable you to rapidly develop database-centric applications using Java EE, Spring, Hibernate, POJOs, or combinations thereof.
The MyEclipse Database Explorer enables direct access to your enterprise data stores and provides the following features:
- JDBC connection templates for all popular relational databases
- SQL Editor with code completion and query execution
- ERD Viewer
- Enhanced DB Editing Capabilities
- Database browser for exploring database structure, e.g., tables, columns, sequences
- View table and JDBC connection details
- Manually edit table data
- DDL export
- Integrated Derby database and JDBC driver for testing
- Export table definition to Hibernate project for Java OR mapping
Any application that uses a database needs some sort of a persistence layer. MyEclipse supports persistence creation or generation using the JPA OR Mapping, Hibernate OR Mapping or EJBs with or without using the Spring framework.
The Database Explorer perspective presents an optimal layout of views and editors for database-centric tasks. To open this perspective, select Window>Open Perspective>MyEclipse Database Explorer from the menu.
You can create new MyEclipse JDBC drivers for connecting to your database. The MyEclipse Database Explorer supports many database servers such as:
Add a new driver using the context menu in the DB Browser view.
Use the Database Driver wizard to quickly set up the driver using pre-installed driver templates. Use the Test Driver button to ensure supplied details are correct.
You can choose to see all catalogs/schemata in your database or only a selected few.
Use the Export and Import wizards to share driver definitions between workspaces and machines.
MyEclipse drivers can be imported either from a previously exported file or from an existing workspace.
The DB Browser view is the primary view from which DB tasks can be initiated. Database entities from all connected drivers are displayed in this view.
Use the Table wizard to create new tables in the selected catalog/schema.
Use the Foreign Key wizard to create a new foreign key between selected tables.
Use the Index wizard to create a new index on column(s) of a selected table.
The DB Connection Info view displays database connection properties for the selected driver.
The Table/Object Info view contains a structured display of all available data from the selected database entity.
Use the Edit Data action to bring up an Edit Table view for the selected table. Textual data can be edited in place, and you can add or delete table rows from the Edit Table view.
Open the SQL editor by right-clicking an open connection in the DB Browser, and selecting New SQL Editor from the menu. Alternatively, double-click a SQL or DDL file.
The SQL editor provides content assist based on the selected connection. You can enter multiple queries in the editor and execute them successively.
Results are displayed in the SQL Results view; rows are fetched in configurable increments.
Queries executed in the current session are recorded in the SQL History view.
Generate DDL for existing database entities by right-clicking the entity and selecting Generate>DDL from the menu.
The MyEclipse ER-Designer helps you visually manage the lifecycle of a relational database from design, through implementation, and maintenance. The MyEclipse ER-Designer provides a visual model of existing databases. The ER-Designer utilizes the database connectors of the Database Explorer to access a database's metadata as it reverse engineers the database's entity-relationship (ER) model.
Tables can be added to an existing diagram by dragging and dropping them from the DB Browser.
MyEclipse professional subscribers have access to extended support for the above databases. CRUD operations (where applicable) for packages, procedures, functions, sequences, triggers, etc. are available through the DB Browser view. For example, a list of supported Oracle entities can be seen below.
Does MyEclipse support Oracle, MS SQL Server, PostgreSQL, HypersonicSQL and other DBMSs?
Yes, MyEclipse's database functions are built on top of the JDBC standard. That means any database that has a high-quality JDBC driver should function just fine with MyEclipse.
I am having a hard time using the Database Explorer; it is acting erratic.
Almost every time we have gotten reports of database function problems in the Database Explorer, it was due to an old or buggy JDBC driver (for example the older classes12.zip driver for Oracle). Normally, upgrading your driver or switching to another high-quality driver solves the problem.
I cannot see or create foreign keys in MySQL like you did in the tutorial. Why?
You need to make sure you are using the InnoDB database type or other database type that supports foreign keys in MySQL. The older default MyISAM table type does not support foreign keys.
How can I fine-tune the limits of my result sets or the look of my ER Diagrams?
All these settings can be found by selecting Window>Preferences from the menu, expanding MyEclipse, and selecting Database Explorer.