3

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

By using Microsoft.SqlServer.Management.Smo I can access database structure information from my instance ( server name, table structure, columns, datatype, description, default value)

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

any directions?

thanks

Ed

RollRoll
  • 8,133
  • 20
  • 76
  • 135

3 Answers3

4

The simplest way to accomplish it is by retrying the connection metadata, first you open a connection:

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

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

Timoteo Ponce
  • 510
  • 9
  • 27
3

DatabaseMetaData will be useful for your requirement.

please also check nearly similar stackoverflow question

Community
  • 1
  • 1
Balaswamy Vaddeman
  • 8,360
  • 3
  • 30
  • 40
1

use the DatabaseMetadata for get database related information. Database Metadata

Rakesh Patel
  • 393
  • 2
  • 10