






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Lecture 17
In simple terms, Meta Data is data (information) about data. The actual data has no meaning without existence of Meta data. To clarify this, let’s look at an example. Given below are listed some numeric values
What this information about? We cannot state accurately. These values might be representing some one’s salaries, price, tax payable & utility bill etc. But if we specify Meta data about this data like shown below:
Salary 1000 2000 4000
Now, just casting a glance on these values, you can conclude that it’s all about some ones salaries.
ResultSet Meta Data will help you in answering such questions
Creating ResultSetMetaData object
From a ResultSet (the return type of executeQuery() ), derive a ResultSetMetaData object by calling getMetaData() method as shown in the given code snippet (here rs is a valid ResultSet object):
ResultSetMetaData rsmd = rs.getMetaData();
Now, rsmd can be used to look up number, names & types of columns
Useful ResultSetMetaData methods
getColumnCount ( )
getColumnDisplaySize (int)
getColumnName(int) / getColumnLabel (int)
getColumnType (int)
Compile & Execute:
The database contains the following values at the time of execution of this program. The database and the output are shown below:
This code is modification of the example code 17.1. Changes made are shown in bold face.
Compile & Execute
On executing the above program, the following output will produce:
4. Type – 2: Native – API/partly Java driver
4. Type – 4: Native – protocol / all – java driver 4.