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
| public static void Predir(long iduser)
{
long topk[]=SelectionTPK(iduser);
//int k=0,j=0;
try{k=0;
St = ConnexionDB.Con.createStatement();
rs =(ResultSet)St.executeQuery("SELECT * FROM fiche_evaluation WHERE id_user='"+iduser+"'");
while(rs.next()){
for(int i=0;i<idtopk.length;i++)
{
if(rs.next()) rs1 =(ResultSet)St.executeQuery
("SELECT * FROM fiche_evaluation WHERE id_user='"+topk[i]+"' AND id_hotel!='"+rs.getLong(2)+"'");
while(rs1.next())
{
grapheagrégé(iduser, rs1.getLong(2));
pred[0][k]=rs1.getLong(2);//l'hotel prédit
pred[1][k]=calculernotepredit(grapheagrégé(iduser, rs1.getLong(2)));//sa note prédite
k++;
}
}
System.out.print("llllllllllllllll");
}
recommande(pred);
}
catch ( SQLException e ) {
throw new DAOException( e );
}
} |
Partager