Home  >  Article  >  Java  >  Java determines whether a certain table exists in the database

Java determines whether a certain table exists in the database

王林
王林Original
2020-02-05 16:03:324372browse

Java determines whether a certain table exists in the database

1. Establish a JDBC data source and judge it through the Java.sql.DatabaseMetaData interface.

For example:

(free learning video tutorial recommendation: java video tutorial)

Java determines whether a certain table exists in the database

2. Directly use sql statement to query from the database

select * from user_all_tables where table_name='tableName'

If the result is empty, it means it does not exist, how to If the result is not empty, it means it exists;

Java determines whether a certain table exists in the database

Related article tutorial sharing: java introductory tutorial

The above is the detailed content of Java determines whether a certain table exists in the database. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn