The database in the data table has a users column with an enum data type that contains an enumeration.
How to get data from this column?

Request example:

 String sql = "SELECT `users` FROM data WHERE `name`=?"; PreparedStatement stmt = connect().prepareStatement(sql); stmt.setString(1, user.toLowerCase()); ResultSet result = stmt.executeQuery(); if(result.next(){ result.getЧТО-ТО() } 

Help, please, with a data output.

  • The same question, only the answer in the English version: ru.stackoverflow.com/questions/656688/… - default locale
  • It is also interesting how to enter data into an enum column - Dinar Zaripov
  • Also a good question, but it is better to ask it separately, because here you have already answered. - default locale

1 answer 1

Try this

 while ( result.next() ) { String users = result.getString("users"); System.out.println(users); }