Changed the Select Query function in LogToDB.java
Pulled in Natraj's changes