How Do You Get a List of SQL's Keywords? in JDBC

Each database has a finite set of SQL keywords. JDBC enables you to get a list of
these keywords for a specific database. You can use
DatabaseMetaData.getSQLKeywords() to retrieve a set of SQL keywords. Next I present a Java servlet (GetSQLKeywords), which will be able to get a list of SQL keywords as HTML or XML. Here is the signature of the servlet:

GetSQLKeywords?vendor=<vendor-name>&format=<HTML-or-XML>

You may add other parameters to suit your database application. Here, I use vendor to act as a database selector. So, to get the table information as XML for a MySQL database, you may invoke it as

The Solution

Invoking GetSQLKeywords for MySQL

Figure : shows how to run the solution for the MySQL database.

Invoking GetTablesAndViews for Oracle

Figure : shows how to run the solution for the Oracle database.



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

JDBC Topics