/**
   * This method is used for adding a new song to the database
   *
   * @param s The song you wish to add to the database
   * @return SUCCESS if it successfully inserted, otherwise OTHER
   */
  @Override
  public int addNewSong(Song s) {
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
      con = getConnection();
      Blob data = con.createBlob();
      Blob art = con.createBlob();
      try {
        if (s.getSongdata() != null) data.setBytes(1, s.getSongdata());
        if (s.getArtwork() != null) art.setBytes(1, s.getArtwork());
      } catch (Exception e) {
        if (DEBUG) e.printStackTrace();
      }
      String query =
          "INSERT INTO "
              + TABLE_NAME
              + " ("
              + FILENAME
              + ", "
              + TITLE
              + ", "
              + ARTIST
              + ", "
              + ALBUM
              + ", "
              + GENRE
              + ", "
              + YEAR
              + ", "
              + DURATION
              + ", "
              + PRICE
              + ", "
              + LICENSE
              + ", "
              + PLAYCOUNT
              + ", "
              + UPLOADDATE
              + ", "
              + ARTWORK
              + ", "
              + SONGDATA
              + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
      ps = con.prepareStatement(query);
      ps.setString(1, s.getFilename());
      ps.setString(2, s.getTitle());
      ps.setString(3, s.getArtist());
      ps.setString(4, s.getAlbum());
      ps.setString(5, s.getGenre());
      ps.setInt(6, s.getYear());
      ps.setInt(7, s.getDuration());
      ps.setDouble(8, s.getPrice());
      ps.setString(9, s.getLicense());
      ps.setInt(10, s.getPlayCount());
      ps.setDate(11, s.getUploaded());
      ps.setBlob(12, art);
      ps.setBlob(13, data);
      if (ps.executeUpdate() > 0) return SUCCESS; // It successfully inserted into the database
    } catch (SQLException e) {
      if (DEBUG) e.printStackTrace();
    } finally {
      try {
        if (rs != null) rs.close();
        if (ps != null) ps.close();
        if (con != null) freeConnection(con);
      } catch (SQLException e) {
        if (DEBUG) e.printStackTrace();
        return SQLEX;
      }
    }
    return OTHER;
  }