Hi,

You should be able to use the jpa entityManagerFactory by defining a field in your mailet

@PersistenceUnit
private EntityManagerFactory entityManagerFactory;

Invoke in your code to get an entityManager:
EntityManager entityManager = entityManagerFactory.createEntityManager();

This will be configured based on the james-database.properties file.

From there, it's plain JPA, where plain JDBC is also supported (entityManager.createNativeQuery).

Thx, Eric


On 05/01/2013 15:35, Rajender Vallapureddy wrote:
Hi Eric,

I have a requirement where I need to open database connection within
my custom mailet. Is there any connection API within james that I can
use and make queries to the database.


Would appreciate your help :)

Thank you,
Regards,
Rajender

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to