1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
package bdd.server;
import java.sql.ResultSet;
import java.sql.SQLException;
import bdd.client.GreetingService;
import bdd.shared.FieldVerifier;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
/**
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements
GreetingService {
@Override
public String connectionBdd(String url, String login, String password) {
String requete="SELECT id,nom,prenom,admin FROM User ";
ConBDD connexion=new ConBDD(url,login,password);
ResultSet resultat=connexion.getData(requete);
if (resultat==null)
return null;
try {
while (resultat.next()){
String p="";
p+=(resultat.getString("id"));
p+=(resultat.getString("nom"));
p+=(resultat.getString("prenom"));
p+=(resultat.getBoolean("admin"));
System.out.println(p); //juste pour voir si en console cela marche
return p;
}
return null;
}catch (SQLException e) {
e.printStackTrace();
return null;
}
}
} |