Using additional sqlserver database

Hi,

I’m new in Cuba and I need to recover data from an external sqlserver database. So I generated an additional data store and Cuba generates a XXXX-persistence.xml file. But I’m facing several problems.

So, How can I retrieve data from this database using an EntityManager? Is that possible?

Thanks.

Hi,

You can retrieve data using DataManager or EntityManager.

Sample with EntityManager:

Transaction tx  = persistence.createTransaction("<storeName>");
try {
  EntityManager = persistence.getEntityManager("<storeName>"); 

  //do some logic here

} finally {
   tx.end;
}