Den nemmeste måde ville være
String query = "select LastModified from CacheTable where url = '" + url +"'";
Du bør dog bruge bindevariabler:
String query = "select LastModified from CacheTable where url = ?";
prepStmt = conn.prepareStatement(query);
prepStmt.setString(1, url);
rs = prepStmt.executeQuery();