Java -- mysql -- get all table names and table field names ., Mysqltable
Obtain the names of all tables in the database:
(Reference: http://stackoverflow.com/questions/2780284/how-to-get-all-table-names-from-a-database)
DatabaseMetaData md =
MySQL常用指令,java,php程序员,数据库工程师必备。程序员小冰常用资料整理MySQL common commands (for reference)The most common display commands are:1. Display the list of databases.show databases;2. Display the data table in the library:Use MySQL;Show tables;3, display the
PHP tutorial MySQL tutorial get the specified database tutorial all table names
If you want to show MySQL a table name for a specified database, the method is simple, MySQL provides a show tables command, it returns a data, the following is a
MySQL creates a table and creates a . frm file to save the table and column definitions. The index is stored in one . MYI (Myindex) and the data is stored in the . MYD (MYData) file extension. First, using Show/describe statement to display the data
When creating a table, MySQL creates a. frm file to save the table and column definitions. Indexes are stored in a file with the. MYI (MYindex) Extension and data is stored in a file with the. MYD (MYData) extension.
1. Use the SHOW/DESCRIBE
Get all table names for database:(Reference: Http://stackoverflow.com/questions/2780284/how-to-get-all-table-names-from-a-database)DatabaseMetaData MD == md.gettables (nullnullnull); while (Rs.next ()) { System.out.println (rs.getstring
PHP MySQL three ways to get table field names and fields information
The information for the tables used in this example is given first:
Get table field information using DESC
The PHP code is as follows:
Operation Result:
Array ( [Field] =
After you log in to the database, the following prompts are found when you select the databasemysql> Use testReading table information for completion of table and column namesCan turn off this feature to get a quicker startup with-aDatabase
In MySQL to display all the table names in the specified database we have a command show tables can be implemented, let me take a look at how show tables get all the table names in the MySQL database.
Use Direct cmd command mode
The code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.