Erreur java.sql.SQLException: Column not found: ADMIN in statement
Bonjour à toutes et à tous,
J'ai un problème qui me bloque depuis deux jours. je commence réellement à désespérer.
Donc merci d'avance de votre aide;
En effet, j'utilise la méthode suivante dans ma servlet: "alhou.inscrire(id,log);" définie ainsi dans mon bean:
Code:
1 2 3 4 5 6 7 8 9
| public void inscrire(int idTache, String log) {
Tache t= findTache(idTache);
Query q=em.createQuery("From Participants p WHERE p.login="+log);
Participants p=(Participants)q.getSingleResult();
List<Participants> lp= t.getLeParticipant();
lp.add(p);
t.setLeParticipant(lp);
// em.persist(t);
} |
A l'exécution j'ai l'erreur suivante:
Code:
Caused by: java.sql.SQLException: Column not found: ADMIN in statement [select top ? participan0_.idParticipants as idPartic1_179_, participan0_.login as login179_, participan0_.password as password179_, participan0_.specialite as specialite179_, participan0_.statut as statut179_ from Participants participan0_ where participan0_.login=admin]
Je ne sais plus quoi faire. J'ai tout essayé; rien du tout.
Merci de m'aider please.
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role
Bonjour,
J'ai le message d'erreur suivant quand j'essaye d'afficher une liste de "Participants" dans ma jsp:
"org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: projet.ejb.Tache.leParticipant, no session or session was closed ".
J'ai l'impression qu'elle vient de ma requête; cependant, je ne vois pas quelle solution je pourrai bien utilisée.
"
Code:
1 2 3 4 5 6 7 8 9 10
| for (Tache t : inscrits) {
%>
<br><%=i%>-<%=t.getTitre() %><br>
<!--Pour chaque tâche, on a une liste d'inscrits non validés -->
<% i=i+1;
List<Participants> lp=new ArrayList<Participants>();
lp=t.getLeParticipant(); // ????????????
for (Participants p: lp) { ....
}
} |
"
Merci d'avance de votre aide.