Rectangle 27 1

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))
{
    pstmt.setString(1, login); 
    pstmt.setString(2, pass); 
    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.

java - JDBC MySQL query syntax - Stack Overflow

java mysql jdbc
Rectangle 27 0

If the item is of String type, then you need to enclose it in quotes. Better yet, you should use a PreparedStatement, to execute the query.

java - Having a mySQL error, unknown column where clause - Stack Overf...

java android mysql servlets
Rectangle 27 0

Turns out my problem wasn't single quotes at all as suggest by Alex Poole (thank you Alex). It was that my Java string needed to be cast to the Oracle type CHAR(17). After I did that no quotes, single or double, were necessary and my named parameters resolved correctly and the query worked.

java - NamedParameterJdbcTemplate Oracle SQL, how to escape single quo...

java sql oracle jdbc spring-jdbc
Rectangle 27 0

If the item is of String type, then you need to enclose it in quotes. Better yet, you should use a PreparedStatement, to execute the query.

java - Having a mySQL error, unknown column where clause - Stack Overf...

java android mysql servlets
Rectangle 27 0

If the item is of String type, then you need to enclose it in quotes. Better yet, you should use a PreparedStatement, to execute the query.

java - Having a mySQL error, unknown column where clause - Stack Overf...

java android mysql servlets