use of org.whole.lang.rdb.codebase.DBSchemaTemplateFactory in project whole by wholeplatform.
the class ImportSchemaExample method importSchema.
protected void importSchema() throws Exception {
// create a connection to a local database
Class.forName("org.h2.Driver");
Connection connection = DriverManager.getConnection("jdbc:h2:mem:" + DBNAME);
// reverse engineer
DBSchemaTemplateFactory dbSchemaTemplateFactory = new DBSchemaTemplateFactory(connection, DBNAME, null);
Database database = dbSchemaTemplateFactory.create();
// pretty print the obtained model
PrettyPrinterOperation.prettyPrint(database);
connection.close();
}
Aggregations