Code Examples Using the SchemaCrawler API
Overview
The SchemaCrawler API is a much simpler alternative to using JDBC metadata. The API example demonstrates the use of the SchemaCrawler API to create a data source, and obtain database metadata.
Example Code
- An example of using the SchemaCrawler API to obtain database metadata in a plain Java object model.
- An example of using the SchemaCrawler API to generate a description of database metadata in an HTML file.
- An example of using the SchemaCrawler API to obtain result-set metadata.
- An example of using the SchemaCrawler API to build an ER model with entities and relationships.
How to Experiment
- Try uncommenting the code block in
com.example.ApiExample.javathat modifies the default options. - Read the SchemaCrawler javadoc, and edit
com.example.ApiExample.javato print more details. - Make changes to
com.example.ExecutableExample.javato produce different types of output.
Additional Resources
Also see schemacrawler/SchemaCrawler-Plugins-Starter for code on how to add new SchemaCrawler commands, extend SchemaCrawler lint rules, or create a new database plugin.