A Paul
A Paul

Reputation: 8261

Play Framework 1.2.6 connect multiple database

I am able to connect to my default database. But added to that I also want to connect another database. I am using Play Framework 1.2.6. I know that this support is present in the main branch of Play 1.2.x. Can any one please help me, how I can achieve this in 1.2.6.

Thank you

Upvotes: 0

Views: 1752

Answers (4)

Semantyc
Semantyc

Reputation: 11

You can try to use this module : http://www.playframework.com/modules/multidb

Aj.

Upvotes: 0

Harish
Harish

Reputation: 726

Found another interesting solution to your problem. Use below link if you need occasional access to the second database.

click here

Upvotes: 0

Harish
Harish

Reputation: 726

What database are you using? If your database supports multiple schemas you can achieve what you want by adding the following line on top of class.

@Entity
@Table(name="<table_name>",schema="<schema_2>")
public class xxx extends Model {

Entity and Table are part of the persistence api.

Upvotes: 0

mkurz
mkurz

Reputation: 2826

Play 1.2.6 (or the 1.2.x branch) doesn't support multiple database connections out of the box. This support will be available in Play 1.3 which has not been released yet.

Here is the according ticket from the Play bug tracker:
http://play.lighthouseapp.com/projects/57987-play-framework/tickets/706

Upvotes: 1

Related Questions