chapter_006/src/main/java/ru/job4j/store/StoreSQL.java
/**
     * Check table existence.
     * If the table is not created, create a table.
     */
Check table existence.
If the table is not created, create a table.
Check table existence . If the table is not created create a table .
private void checkTable() {
        try {
            DatabaseMetaData dbm = conn.getMetaData();
            rs = dbm.getTables(null, null, "entry", null);
            if (rs.next()) {
                checkRecords();
            } else {
                this.st = conn.prepareStatement(CREATE_TABLE);
                st.executeUpdate();
            }
        } catch (SQLException e) {
            LOGGER.error(e.getMessage(), e);
        }
    }
private void checkTable ( ) { try { DatabaseMetaData dbm = conn . getMetaData ( ) ; rs = dbm . getTables ( null , null , "entry" , null ) ; if ( rs . next ( ) ) { checkRecords ( ) ; } else { this . st = conn . prepareStatement ( CREATE_TABLE ) ; st . executeUpdate ( ) ; } } catch ( SQLException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } }
Check table existence.
Check table existence .