la commande SQL ne se termine pas correctement
Bonjour,
j'ai une table Projet et une table ressoures avec une relation many to many. j'ai définie une méthode qui me permet d'avoir les projets de chaque ressource :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| public List getProjetParRessource(Long idR){
List<Projet> PrjRes=new Vector<Projet>();
try{
Session session=HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
// session.connection().prepareStatement("").
//ResultSet rs=session.connection().prepareStatement("select p.INTITULE_PROJET,p.ID_PROJET from GPL_PROJETS p,GPL_AFFECTATIONS a"+
//"where p.ID_PROJET=a.ID_PROJET and a.ID_RESSOURCE="+idR).executeQuery();
ResultSet rs=session.connection().prepareStatement("select p.INTITULE_PROJET,p.ID_PROJET from GPL_PROJETS p,GPL_AFFECTATIONS a"+
"where p.ID_PROJET=a.ID_PROJET and a.ID_RESSOURCE="+idR).executeQuery();
while(rs.next()){
Projet p=new Projet();
p.setIdProjet(rs.getLong("ID_PROJET"));
p.setIntituleProjet(rs.getString("INTITULE_PROJET"));
PrjRes.add(p);
}
}
catch (Exception e) {
e.printStackTrace();
}
return PrjRes;
} |
Mais ça me retourne l'erreur suivante:
Code:
java.sql.SQLException: ORA-00933: la commande SQL ne se termine pas correctement
Quelqu'un a une idée?
Merci d'avance.