Java開源的數據庫結構操作框架 SchemaCrawler 8.8 發布
SchemaCrawler提供一組用于增強標準JDBC Metadata的API.SchemaCrawler還包含一個命令行工具能夠將數據庫結構和數據以一種易讀的形式輸出.
新版本支持輸出 JSON 格式的數據庫結構,便于在網站上發布;另外 SchemaCrawler Maven 插件不再單獨分開成一個獨立的項目。
項目地址:http://schemacrawler.sourceforge.net/
SchemaCrawler
SchemaCrawler is an open-source Java API that makes working with database metadata as easy as working with plain old Java objects.
SchemaCrawler is also a database schema discovery and comprehension, and schema documentation tool. You can search for database schema objects using regular expressions, and output the schema and data in a readable text format. The output is designed to be diff-ed against other database schemas.
SchemaCrawler API
Java programmers need to access database metadata
- in order to dynamically generate SQL statements
- when programmatically determining the capabilities of a given RDBMS
- when finding the names and types of tables and columns in the database
final SchemaCrawlerOptions options = new SchemaCrawlerOptions(); // Set what details are required in the schema - this affects the // time taken to crawl the schema options.setSchemaInfoLevel(SchemaInfoLevel.standard());final Database database = SchemaCrawlerUtility.getDatabase(connection, options); for (final Schema schema: database.getSchemas()) { System.out.println(schema); for (final Table table: schema.getTables()) { System.out.println("o--> " + table); for (final Column column: table.getColumns()) { System.out.println(" o--> " + column); } } }</pre>
本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!