The problem is to write the correct line with the prepared statementom ..
Where is the syntax error?
Class.forName("com.mysql.jdbc.Driver"); connection = DriverManager.getConnection(URL,USER_NAME,PASSWORD); String checkingUser = "SELECT nick_name FROM users WHERE nick_name=? AND password=? AND users.email=?"; PreparedStatement preparedStatement = connection.prepareStatement(checkingUser); System.out.println("Before 1"); preparedStatement.setString(1,loginData[0]); System.out.println("Before 2"); preparedStatement.setString(2,loginData[1]); System.out.println("Before 3"); preparedStatement.setString(3,loginData[2]); preparedStatement.execute(); com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to user near '?, password=?, users.email=?' at line 1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND password=? AND users.email=?' at line 1 // перезагрузил сервак, получил данную ошибку. Что тут нетак не понимаю.. Пример кода в другой части програмы, который работает. String e = "UPDATE coupon SET start_date = ? , end_date = ? , amount = ? , price = ? , image = ? WHERE id = ?"; Problem with and ??
SELECT nick_name FROM users WHERE nick_name="****" AND password="*****" AND users.email="******"; This design works in the usual database query. But not with the Prepared Statement.
Receive alerts from IDEA SQL Dialect is not configured! What and how do I set up?
users.emailand why is it not just anemail? - post_zeew