[SQLITE_ERROR] Ошибка SQL или отсутствует база данных (рядом с "(": синтаксическая ошибка)
try {
String sql = "SELECT MAX (right(id_kasir,3)) AS no FROM tbl_kasir";
st = connection.createStatement();
rs = st.executeQuery(sql);
while (rs.next()) {
if (rs.first() == false) {
txtidkasir.setText("KS001");
} else {
rs.last();
int auto_id = rs.getInt(1) + 1;
String no = String.valueOf(auto_id);
int noLong = no.length();
for (int a = 0; a < 3 - noLong; a++) {
no = "0" + no;
}
txtidkasir.setText("KS" + no);
}
}
} catch (Exception e) {
System.out.println("Error" + e.getMessage());
}