• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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);
        }
   
            }
    }                                       
 
author
Sheriff
Posts: 23306
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
 
Marshal
Posts: 56831
173
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!