Ich habe wiedermal ein kleines Problem ...
Code:
public Location getVectorLeft(String pn, World w) throws SQLException {
Statement stmt = null;
ResultSet rs = null;
Connection con = DriverManager.getConnection(url, user, pass);
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT x, y, z FROM users WHERE name='"+pn+"';");
while(rs.next()) {
double x = rs.getDouble(1);
double y = rs.getDouble(2);
double z = rs.getDouble(3);
Location loc = new Location(w,x,y,z); // Diese Location möchte ich zurückgeben...
}
return loc; // Variable loc ist nicht Verfügbar, da sie nur "local" ist, dass möchte ich ändern !
}