private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        if (rb3.isSelected() || rb4.isSelected()) 
        {
            try 
            {
                prefs.flush();
            } 
            catch (Exception e)
            {
                logger.error("Error Description:", e);
            }
            File dir1 = new File(JarLocation.getLocation(this) + "\\databases\\");
            if (!dir1.canRead()) 
            {
                dir1.mkdirs();
            }
            
            // Create the required tables
            String query[] = {"create table settings(fine integer,issuetime integer,maxbooks integer);"
                    ,"create table users (issuerId integer(5) ,fname varchar(15), lname varchar(15),username varchar(20) Primary key,password varchar(32),gender varchar(10),address varchar(40), phoneno long , type varchar(10));"
                    ,"create table books( bookcode integer Primary Key,bookname varchar(50),author varchar(40),Releasedate varchar(25),Pages integer,genre varchar(30),review varchar(1000),imgurl varchar(150));"
                    ,"create table accounts(IssuerId integer,username Varchar(10),BookCode integer Primary Key,Bookname Varchar(50),IssueDate date,ReturnDate date);"
                    ,"insert into settings values(1,7,3);"
                    ,"Insert into users values (100,\"admin\",\"admin\",\"admin\",\"c75af13c992650118785608ba2506a3\",\"Male\",\"null\",9764578654,\"admin\");"};
 
            for(int i=0;i<=5;i++)
            {
                 MyQueries.excUpdate(query[i]);
                 myClasses.Connections.close(); // Close connection to prevent Database lock
            }
            
            if (rb3.isSelected()) 
            {
                jProgressBar1.setVisible(true);
                rb3.setVisible(false);
                rb4.setVisible(false);
                
                File dir = new File(JarLocation.getLocation(this) + "\\images\\");
                if (!dir.canRead())
                {
                    dir.mkdirs();
                }
                              
                //Call the SwingWorker
                threads.DbPopulator task = new threads.DbPopulator(l5,this);  
                task.addPropertyChangeListener(
                new PropertyChangeListener()
                {
                    @Override
                    public void propertyChange(PropertyChangeEvent evt) 
                    {
                        if (evt.getPropertyName().equals("progress")) 
                        {
                            jProgressBar1.setValue((Integer) evt.getNewValue());
                        }
                    }
                });
                task.execute();      
            }
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Please select one of the options");
        }
    }//GEN-LAST:event_jButton5ActionPerformed