Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code -  RSS feed

 
nonkfu geraldine
Greenhorn
Posts: 5
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
private void PasswordFieldKeyPressed(java.awt.event.KeyEvent evt) {                                        
        // TODO add your handling code here:
        if(evt.getKeyCode()== KeyEvent.VK_ENTER)
            {
                 Connection connection = null;
PreparedStatement ps;
        try {
            connection = DriverManager.getConnection("jdbc:php://localhost:3306/Local Database/<signin>", "root", "");
            ps = connection.prepareStatement("SELECT 'Username', 'Password' FROM 'signin' WHERE 'Username' =? AND 'Password' = ?");
            ps.setString(1, userNameField.getText());
            ps.setString(2, String.valueOf(PasswordField.getPassword()));
           
     ResultSet result = ps.executeQuery();
     if(result.next())
     {
     Message.setText("Login Successful");
     Message.setForeground(Color.GREEN);
     timer.start();
     }
    
     else
     {
          Message.setText("Invalid Username or Password");
     Message.setForeground(Color.CYAN);
     timer.start();
     }
//ResultSet rs;
        } catch (SQLException ex) {
            Logger.getLogger(Signin.class.getName()).log(Level.SEVERE, null, ex);
        }
   
            }
    }                                       
 
Henry Wong
author
Sheriff
Posts: 23275
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this first...

https://coderanch.com/wiki/660183/Fix-Compiler-Errors-Running-Application

The error message shown can't be used as is. You need to actually compile the program, and show us the first few compiler errors.  See the wiki post for reasons.

Henry
 
Campbell Ritchie
Sheriff
Posts: 55292
156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought you only get that Exception from IDEs. There shou‍ld be a red mark to the left of the incorrect part of code and a message will appear if you hover your mouse on it. You may find suggestions for correcting the error, too, by clicking the red mark.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!