private void LogInButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LogInButtonActionPerformed
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con = DriverManager.getConnection("jdbc:odbc:VideoStore", "", "");
            Statement stat = con.createStatement();
            String query = new String(MoviePasswordField.getPassword());
            ResultSet results = stat.executeQuery("SELECT * FROM Users "
                                                + "WHERE user_name = '" + UserNameTextField.getText() + "' AND password = '"
                                                + query + "'");
            if (!results.next()) {
                throw new InvalidPasswordException();
            } else {
                JOptionPane.showMessageDialog(null, "You are successfully logon", "Logon Status", 1);
                MovieTitleATextField.setEnabled(true);
                MovieGenreTextField.setEnabled(true);
                MovieDescTextField.setEnabled(true);
                MovieAddButton.setEnabled(true);
                GenreNameTextField.setEnabled(true);
                GenreAddButton.setEnabled(true);
                MovieTitleRTextField.setEnabled(true);
                MovieTitleRemoveButton.setEnabled(true);
                LogInButton.setEnabled(false);
                try {
                    userSocket = new Socket("127.0.0.1", 6666);
                    out = new PrintWriter(userSocket.getOutputStream(), true);
                    in = new BufferedReader(new InputStreamReader(userSocket.getInputStream()));
                } catch (UnknownHostException e) {
                    JOptionPane.showMessageDialog(null, e, "Error Message", 0);
                } catch (IOException e) {
                    JOptionPane.showMessageDialog(null, e, "Error Message", 0);
                }
            }
            stat.close();
        } catch (SQLException e) {
            JOptionPane.showMessageDialog(null, e, "Error Message", 0);
        } catch (ClassNotFoundException e) {
            JOptionPane.showMessageDialog(null, e, "Error Message", 0);
        } catch (InvalidPasswordException e) {
            JOptionPane.showMessageDialog(null, e, "Error Message", 0);
        }
    }//GEN-LAST:event_LogInButtonActionPerformed