How to add all the databases from server to String array in java? I am using JOOQ api to execute SQL statements and i need to get all the databases in comboBox where i can select specific database.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have several options. For instance, you could use the generated
classes from jOOQ-meta (or generate the information_schema yourself),
and then write:
The same can be achieved through plain SQL, of course:
Or, using the
SHOW TABLEScommand:Another option would be to read from JDBC’s DatabaseMetaData:
In jOOQ 3.0, you will also be able to read the meta data through the jOOQ API: