The SPI and I
2C examples are for the ADXL345 digital accelerometer. They also show you how to wire it up when you open each example. They're two different ways to connect it, choose whichever you like.
Personally I could not get either one working, but if you do - great for you.
The other two examples are not designed for the ADXL345 - they're designed for analog accelerometers, that work with 0-5 v, and so will not work with the ADXL345. You could change them using code from the SPI/I
2C examples to make them work, if you want.
I could not understand from your post what you're seeking assistance with, so I'm guessing the accelerometer doesn't work for you. It doesn't for me either. I'll let you know if I make any progress, but it looks like a lost cause

I'm just about to give up on the ADXL345 and buy an analog accelerometer.