The ADXL345 has a digital interface wheras the ADXL335 has analogue outputs.
Follow the links from this page, especially to the Quick Start Guide:
Note it must be powered by about 3.3 volts, not 5 volts.
It is certainly not advisable to connect the ADXL345 to a 5 volt Arduino as shown in the Quick Start Guide. The Arduino will be applying 5 volt digital signals to the accelerometer. You should use a level shifter (or use I²C and follow this guidance). Here is an example level shifter: https://www.sparkfun.com/products/12009.
I would just buy a ADXL335 which does not need a level shifter (but will give less resolution).