What Are the Table Types Used in a Database? JDBC

Using RDBMS, we store data and metadata in logical tables (which are stored in operating system files). Typically, each database vendor has different types of logical storage types (such as TABLE, VIEW, SYSTEM TABLE, etc.) for storing data and metadata. For example, Oracle does support most of the table types, but some databases (such as MySQL) do not support “views” (MySQL 5.0 does support views, however). In GUI database applications, you might want to distinguish different table types. The getTableTypes() method, defined in the DatabaseMetaData interface, retrieves the table types available in this database. The results are ordered by table type. The result is returned as a ResultSet object in which each row has a single String column that is a table type. A single column is named as TABLE_TYPE.

The table type is

  • "TABLE"
  • "VIEW"
  • "SYSTEM TABLE"
  • "GLOBAL TEMPORARY"
  • "LOCAL TEMPORARY"
  • "ALIAS"
  • "SYNONYM"

The Solution: getTableTypes()

Oracle Client Program

//// print the list of table types//

MySQL Client Program

//// print the list of table types//

MySQL Client Program Output



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

JDBC Topics