exporting data into double array [on hold]

المشرف العام

Administrator
طاقم الإدارة
I want to add retrieved data from database into a array, but it retrieve null. what is my mistake?

for (User u : userLists) { for (Resource r : resourceLists) { String ratingQuery = "SELECT rank FROM ratings WHERE userindex='" + u.getIndex() + "' AND resourceindex='" + r.getIndex() + "'"; try { ratingCon = ConnectionManager.getConnection(); stmt = ratingCon.prepareStatement(ratingQuery); rs = stmt.executeQuery(); while (rs.next()) { rate = rs.getDouble("rank"); ratings[u.getIndex()][r.getIndex()] = rate; //it seems here is the problem } } catch (Exception e) { System.out.println("Log In failed: An Exception has occurred! " + e); } } }

أكثر...
 
أعلى