title: Check if chosen file exists in database using checksum
body: <p>I'm using checksum to check if choosen file already been inserted to database.<br>
  Inserting works fine but I can't manage to check this exist.  </p>
  
  <p>I'm using such code:</p>
  
  <pre><code>            String fileName = fileopen.getSelectedFile().getName();
              String checksumDB = "select top 1 Checksum from dbo.Szyby where Checksum = ?";
              MessageDigest md5Digest = MessageDigest.getInstance("MD5");
              String checksum = getFileChecksum(md5Digest, fileopen.getSelectedFile());
              PreparedStatement prep = conn.prepareStatement(checksumDB);
              prep.setString(1, checksum);
              ResultSet rs = prep.executeQuery();
              if (rs.getInt(1) &gt; 0) {
                  JOptionPane.showMessageDialog(null, "Dublowanie", "ERROR", JOptionPane.ERROR_MESSAGE);
              }
  </code></pre>