String statement = "SELECT admin from private union SELECT user2 from private";
prep = conn.prepareStatement(statement);
ResultSet rs = (ResultSet) prep.executeQuery();
while(rs.next()) {
temp1.setAdmin(rs.getString("admin"));
temp1.setMem2(rs.getString("user2"));
leagues.add(temp1);
}
conn.close();
Error:
Column 'user2' not found
The error is when I run it and it says no data to display.
There is a column user2 in the private table in the sql database, as the full statement works at command line.