code: private int readFileId(Path filePath, Connection conn) {
          int fileId = -1;
          try {
              Statement stmt = conn.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT id FROM file where path = '" + filePath.getParent() + "';");
              while (rs.next()) {
                  fileId = rs.getInt("id");
              }
              stmt.close();
          } catch (SQLException e) {
              e.printStackTrace();
          }
          return fileId;
      }
docs: Read file ID from the database.
  
  @param filePath  Path to the file
  @param conn      Database connection
  @return          File ID in the database