首页新闻找找看学习计划

关于MySQL8.0 ResultSet next() 返回true问题

0
[已关闭问题] 关闭于 2019-11-25 16:12

public static void main(String[] args) throws SQLException, ClassNotFoundException {
JowDistr.DB dbConfig = JowDistr.loginConfig.dbConfig;
DBConfig.init("", dbConfig);
Connection conn = DriverManager.getConnection(DBConfig.DB_URL, DBConfig.DB_USER,
DBConfig.DB_PWD);
System.out.println(DBConfig.DB_URL);
DatabaseMetaData databaseMetaData = conn.getMetaData();
// 从DatabaseMetaData获取表信息
ResultSet tableSet = databaseMetaData.getTables(null, "wild_login", "login_account", new String[] { "TABLE" });
while(tableSet.next()) {
System.out.println("---------------------" + tableSet.getString(1));
}
tableSet.close();

    ResultSet _tableSet = databaseMetaData.getTables(null, "wild_login", "core_id_allot", new String[] { "TABLE" });
    while(_tableSet.next()) {
        System.out.println("---------------------" + _tableSet.getString(1));
    }
    _tableSet.close();
}

打印:
jdbc:mysql://127.0.0.1:3306/wild_login?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&createDatabaseIfNotExist=true
---------------------wild_login
---------------------wild_game0

滑小鸡的主页 滑小鸡 | 初学一级 | 园豆:174
提问于:2019-11-25 16:08
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册