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

Java determines whether a certain table exists in the database

王林
Release: 2020-02-05 16:03:32
Original
4442 people have browsed it

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'
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template