
and now i wont to get the data(name) from the character tabel based on the username.
but i do not know how to do the query for it. i have tried this:
Code: Select all
PreparedStatement new_sql = conn.prepareStatement("SELECT * FROM user LEFT JOIN character ON user.iduser=character.iduser WHERE user.username=?");
new_sql.setString(1, username);
ResultSet new_result = new_sql.executeQuery();
new_result.first();
String name = (String) new_result.getString(0);
trace(name);
i hope you can help me.