As mentioned in the comments the problem you are getting is because the strings you are supplying for your login and passwords are not enclosed in single quotes.
The quick way around this is to include single quotes in your defined sql string before and after you are including the passed in values for the log in and password as mentioned by @DevilsHnd in the comments:
String consulta = "SELECT COUNT(*) FROM Perit WHERE LOGIN = '" + Login +
"' AND PASSWORDMD5 = MD5('" + pass + "');"
However this a is dangerous approach and I highly recommend that you do not use this approach as it leaves your login sql vunerable to SQL Injection.
To avoid this, you can use a PreparedStatement which will take care of sanitizing your inputs for you.
You do this by replacing your statement arguments with a ? and then set them using the methods of the PreparedStatement class.
Below is an example of how you can achieve this:
String consulta = "SELECT COUNT(*) FROM Perit WHERE LOGIN = ? AND PASSWORDMD5 = MD5(?);"
try(PreparedStatement pstmt = con.prepareStatement(consulta))
try(ResultSet rs = pstmt.executeQuery())
count = rs.getInt(1);
catch (SQLException ex)
Logger.getLogger(JDBCMySQL.class.getName()).log(Level.SEVERE, null, ex);
Another area of concern in your method is that your Statement and ResultSet are not closed within a finally block - this could lead to memory leaks within your code.
Note my use of a try with resources block - which will close the PreparedStatement and ResultSet as if they were closed in a finally block.