Hi,
The categories assigned to a document are stored in a property on the node that represents the document. This property is multi-valued.
You can see the definition of this property by taking a look at contentModel.xml (in /alfresco/model). Search for the aspect cm:generalclassifiable and you'll see it defines the property cm:categories. We support categorisation by adding this aspect to any node that requires it.
In your question, I assume you're referring to the JCR API, not jackrabbit (that's a completely different project - Apache). You can get and set the values of this property via any of Alfresco's APIs. The values are node references to category objects held in the Repository.
If you classify a document in the Alfresco Web Client and then take a look at the document via the Node Browser (from the Administration Console), you will see the category property and its values for an example.