A library for binding results of methods defined in DatabaseMetaData.
All 26 methods in DatabaseMetaData that return ResultSet are bound to type-safe Java classes.
Full documentation lives in the project wiki:
- Home — overview and quick start
- API Reference — the bound methods
- Model Notes — binding behavior and catalog/schema/pattern handling
- Testing and Build — build requirements and running tests
- Known Issues — driver-specific quirks
See Maven Central for available versions.
<dependency>
<groupId>io.github.jinahya</groupId>
<artifactId>database-metadata-bind</artifactId>
</dependency>try (var connection = dataSource.getConnection()) {
var context = Context.newInstance(connection);
// Get all catalogs
List<Catalog> catalogs = context.getCatalogs();
// Get all tables (null = don't filter)
List<Table> tables = context.getTables(null, null, "%", null);
// Get columns for a specific table
List<Column> columns = context.getColumns("my_catalog", "my_schema", "my_table", "%");
}See the wiki for more examples, catalog/schema null handling, and per-driver notes.