Does anyone know of a Java library that provides a useful abstraction for analyzing and processing arbitrary relational database schemas? I am thinking of something that can do something like
LibraryClass dbLib = ...;
DbSchema schema = dbLib.getSchema("my_schema");
List<DbTable> tables = schema.getTables();
and
DbTable myTable = ...
for(DbColumn col : myTable.getColumns()){
... = col.getType();
}
or even manipulate tables like
myTable.addColumn(
new DbColumn("my_new_column", Type.UNSIGNED_INTEGER);
);
DbColumn myColumn = ...
myTable.removeColumn(myColumn);
Most database modeling tools will have an internal internal abstraction, but is there Java in it that I can use, or will I have to roll back my own?
source
share