JavaDB - Checking if a database exists
问题 We created a java application which uses the JavaDB database in Netbeans IDE. We want the program to check every time it starts if the database's tables have already been created, and otherwise create them. How do we do that? thanx 回答1: I use : DatabaseMetaData metas; ResultSet tables; Statement stat; m_connexion = DriverManager.getConnection("jdbc:derby:mybase;create=true"); metas = m_connexion.getMetaData(); stat = m_connexion.createStatement(); tables = metas.getTables(m_connexion