Skip to content

Commit

Permalink
Forgot the most important part!
Browse files Browse the repository at this point in the history
Can't update database without a query. 😄
  • Loading branch information
clj13001 committed Mar 1, 2017
1 parent e2b5cf5 commit 0454577
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/database/MySQLAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void returnDevices(String devices) throws ClassNotFoundException, SQLExce
//make into string array; queries need to have numbers as strings!
String[] deviceArray = devices.replaceAll("\\[","").replaceAll("\\]","").replaceAll("\\s","").split(",");
for(int i = 0; i < deviceArray.length; i++){
String current = deviceArray[i];
//update statement
stmt.executeUpdate("UPDATE devices SET Status = \"Available\" WHERE Device_ID = " + deviceArray[i]);
}
}

Expand Down

0 comments on commit 0454577

Please sign in to comment.