Cara termudah adalah
String query = "select LastModified from CacheTable where url = '" + url +"'";
Anda harus menggunakan variabel bind:
String query = "select LastModified from CacheTable where url = ?";
prepStmt = conn.prepareStatement(query);
prepStmt.setString(1, url);
rs = prepStmt.executeQuery();