How can I identify columns when SELECTing from multiple tables with JDBC?
问题 I have two tables that I join on the id-column, they look like: +-------+ | users | +----+--+---+ | id | name | +----+------+ +-------+ | posts | +-------+------+---------+ | id | user_id | message | +----+---------+---------+ And now I want to select all posts and include the username, with: SELECT * FROM posts, users WHERE user_id = users.id And then I try to get the values with: ResultSet rs = // SQL if(rs.next()) { rs.getInt("posts.id"); ... } But I get SQLException when executing rs