简体   繁体   English

使用Java EE / JPA检索数据库元信息

[英]Retrieving database meta information using Java EE/JPA

I need to be able to retrieve database information from any type of database and return this information via a restful service (using Glassfish and JAX-RS). 我需要能够从任何类型的数据库中检索数据库信息,并通过一个宁静的服务(使用Glassfish和JAX-RS)返回此信息。

The information I need includes: 我需要的信息包括:

  • Database names 数据库名称
  • Table names 表名
  • Column names and properties 列名和属性

I am currently looking into DatabaseMetaData and seems to provide what I require. 我目前正在研究DatabaseMetaData ,似乎提供了我需要的东西。

However, I wanted to check if there are alternatives I should be considering (such as JPA2). 但是,我想检查是否有我应该考虑的替代方案(例如JPA2)。

Any pointers would be appreciated 任何指针将不胜感激

I settled on using SchemaCrawler . 我决定使用SchemaCrawler It is highly configurable and provides me with everything I need. 它具有高度可配置性,可为我提供所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM