实战:第十六章:判断Mysql库中是否存在某表
sql查询库中是否存在该表
案例:
SHOW TABLES IN dreamweb_gjfgw WHERE Tables_in_dreamweb_gjfgw ='g_app_data_service_log'
格式:
SHOW TABLES IN 数据库名称 WHERE Tables_in_数据库名称 ='表名称'
Sql sql = new Sql("SHOW TABLES IN dreamweb_gjfgw WHERE Tables_in_dreamweb_gjfgw ='g_app_data_service_log';");
DataTable dataTable = DBManager.getDataTable(sql);
DataRowCollections rows = dataTable.getRows();
for (DataRow row : rows) {
String data = row.getString("value");
System.out.println("存在这个值:" + data);
}