Background:
String sql = "SELECT * from Atm_user where username=?" and password=? ";
A very common SQL statement where username and password are char (20) and char (32) in Oracle if the query in MySQL is not a problem, the key is that the query in Oracle is, Oracle is supplemented by a space by default when char is not full, typically 3XN length. It's depressing.
The internet has found some processing methods, for reference only:
1. Properties are treated with the trim function: Trim (t.user_id) =?
2. Char changed to VARCHAR2 type
If the char type has a specified number of digits, after filling in the data will automatically add a space after the low bit, VVARCHAR2 will not, so you query the char type, "a" and "a" can not match
So just change the above SQL to the following
String sql = "SELECT * from Atm_user where trim (username) =?" and trim (password) =? ";