index
is a keyword, if you use this as a column name try escaping it with tilts. (`)
....
PreparedStatement ps=(PreparedStatement) dbConnection.prepareStatement(" select `index` from books where `index`=? ");
....
solved Can anyone please correct this SQL syntax exception