I am working on a project where i must get all table names using JPA then store the names somewhere. Using mysql query I can use "Show tables" but using that in JPA doesn't work.How can i achieve this?
Asked
Active
Viewed 469 times
-1
-
use raw jdbc `DatabaseMetaData` – Ramanlfc Sep 22 '17 at 13:20
-
3JPA is not the technology for getting database info! It is object-based persistence – Sep 22 '17 at 13:39
-
Please show an attempt to solve the solution with a specific question regarding a specific problem. – Maciej Jureczko Sep 22 '17 at 14:36
-
Possible duplicate of [How to get all table names from a database?](https://stackoverflow.com/questions/2780284/how-to-get-all-table-names-from-a-database) – Alan Hay Sep 22 '17 at 17:36
1 Answers
-1
I never tried something like that but you can try with that query:
SELECT table_name FROM information_schema.tables where table_schema='<your_database_name>';

TheOni
- 810
- 9
- 26