Getting information about MYSQL database structure from Java

I am trying to do with java and mysql the same thing I have used with .net and SQL server:

Using Microsoft.SqlServer.Management.Smo I can access information about the database structure from my instance (server name, table structure, columns, data type, description, default value)

I tried to find the same with Java + MYSQL, but it seems that it is not that popular

any directions?

thank

Ed

+3


source to share


3 answers


The easiest way to accomplish this is by repeating the connection metadata, first you open the connection:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db", "user","****");
DatabaseMetaData metaData = conn.getMetaData();

      



then start navigating the metadata, you can check the available operations in DatabaseMedata

+4


source


DatabaseMetaData will be helpful for your requirement.



please also check fooobar.com/questions/564874 / ...

+3


source


use DatabaseMetadata to get database related information. Database metadata

+1


source







All Articles