Repeat Exercise 5.13 using ODBC, defining void printable(char *r) as a function instead of a method. Exercise

Question:

Repeat Exercise 5.13 using ODBC, defining void printable(char *r) as a function instead of a method.


Exercise 5.13 

Suppose you were asked to define a class MetaDisplay in Java, containing a method static void printable(String r); the method takes a relation name r as input, executes the query “select * from r”, and prints the result out in tabular format, with the attribute names displayed in the header of the table.

a. What do you need to know about relation r to be able to print the result in the specified tabular format?

b. What JDBC methods(s) can get you the required information?

c. Write the method printTable(String r) using the JDBC API.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Database System Concepts

ISBN: 9780078022159

7th Edition

Authors: Abraham Silberschatz, Henry F. Korth, S. Sudarshan

Question Posted: