Saturday, February 3, 2007

What is metadata?

a. This is the Data Information that a Resultset has fetched. For Example I had a resultset containig all the records from a table of 3 columns say CA,CB, CC. Metadata will all the underlined info about the table and the columns that has been fetched.

b. Basically, Metadata is data about data. In context of JDBC, there may be two types of metadata.

1. Describing information about the Resultset object. i.e, if u have applied a query that fetches some result. this metadata describes information about how many columns have been fetched, their names etc.

2. Second one describes about the database connection

c. Meta Data- is information that describes about structure and properties of our data. When we define a table we specify each columns name, type of data it holds and restrictions imposed (Constraints) and who owns it. This Information in JDBC Context is called MetaData.In JDBC we have two types of Meta Data
(i) ResultSet MetaData
(ii) (ii) DataBase MetaData
(iii) (i)ResultSet MetaData is information about data contained in ResultSet(ii)
DataBase MetaData is Data about Data

d. A single application can have one or more connections with a single database, or it can have connections with many different databases. A user can get information about a Connection object's database by invoking the Connection.getMetaData method. This method returns a DatabaseMetaData object that contains information about the database's tables, the SQL grammar it supports, its stored procedures, the capabilities of this connection, and so on.

SOURCE : www.referjava.com

No comments: