Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8367799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:14:57+00:00 2026-06-09T13:14:57+00:00

I am using MySql, JDBC, Java to make my code. I am unable to

  • 0

I am using MySql, JDBC, Java to make my code. I am unable to understand what some terms in the API mean. It is preventing me from doing the work below-
To make code that checks if a particular DB exists, then checks if a particular table DB exists in that DB, followed by a particular column in that table.

Each table description has the following columns:

TABLE_CAT String => table catalog (may be null)
TABLE_SCHEM String => table schema (may be null)
TABLE_NAME String => table name
TABLE_TYPE String => table type. Typical types are "TABLE", "VIEW", "SYSTEM     TABLE",     "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
REMARKS String => explanatory comment on the table
TYPE_CAT String => the types catalog (may be null)
TYPE_SCHEM String => the types schema (may be null)
TYPE_NAME String => type name (may be null)
SELF_REFERENCING_COL_NAME String => name of the designated "identifier" column of a typed table (may be null)
REF_GENERATION String => specifies how values in SELF_REFERENCING_COL_NAME are  created.      
Values are "SYSTEM", "USER", "DERIVED". (may be null)

What is a table catalog, what is a table schema, SELF_REFERENCING_COL_NAME etc ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:14:57+00:00Added an answer on June 9, 2026 at 1:14 pm

    As far as Connector/J implementation of DatabaseMetadata is concerned TABLE_CAT returns the database name (as in CREATE DATABASE); TABLE_SCHEM is null and SELF_REFERENCING_COL_NAME is not returned.

    This is database and driver specific. As an example, Oracle ojdbc drivers will return null for TABLE_CAT and the object owner for TABLE_SCHEM.


    For your particular task (MySQL + Connector/J):

    1. To check if a particular database exists → Use getCatalogs() to obtain a ResultSet, iterate its rows and retrieve the TABLE_CAT column, your database should match one of its values.
    2. To check if the database contains a particular table → getTables(databaseName, null, tableName, new String[]{"TABLE"}) should return a non empty ResultSet.
    3. To check if the table contains a particular column → getColumns(databaseName, null, tableName, columnName) should return a non empty ResultSet.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make Java code (using Oracle 11g and JDBC also) which will
I'm accessing public mySQL database using JDBC and mySQL java connector . exonCount is
I'm using Mysql database and neatbeans IDE conncting by mysql-connector-java-5.1.21 jdbc , and I
I am trying to connect to a MySQL Server using JDBC tool in java
I trying to implement the active record pattern using Java/JDBC and MySQL along with
I am using JDBC to query a MySQL database for specific records from two
I am using jdbc to select data from a mysql database. I am performing
How would i remove all records from a given mysql table using jdbc in
I have a com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException in my code (using Hibernate and Spring) and I can't
I am a newbie and have some question on using jdbc with java: What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.