Play with Spring JDBC

742 views
Skip to first unread message

Alex Gran

unread,
Mar 29, 2011, 10:13:10 AM3/29/11
to play-framework
Seems like my search for a good Java web framework ends here in this
play ground! I'm starting new application with Play!. But I'd like to
use spring JDBC (which I'm already familiar and I'm pretty much
comfortable with plain SQL) instead of JPA.
Is it possible or doable without any hack ?

Cheers!

Ike

unread,
Mar 29, 2011, 4:37:05 PM3/29/11
to play-fr...@googlegroups.com
You should be able to use the Spring module. No hack required.


I haven't used it in a while so you need to make sure that it works on 1.1 and perhaps the upcoming 1.2.

Matt Hildebrand

unread,
Mar 29, 2011, 4:51:37 PM3/29/11
to play-fr...@googlegroups.com
You can also just copy the relevant Spring JARs to the application's "lib" directory, then write Spring JDBC code as usual.  It works fine.  There is no hack required, and this way the Spring module is also unnecessary.

Best,
-Matt


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Steve Chaloner

unread,
Mar 29, 2011, 5:34:53 PM3/29/11
to play-fr...@googlegroups.com
I'm using Play's jpa support alongside spring jdbc in a quick and dirty migration tool to pull test data from the production db into the redesigned schema of our development db. They work side-by-side with no problems or interference whatsoever.

- Steve

Message has been deleted

sas

unread,
Mar 29, 2011, 10:26:06 PM3/29/11
to play-framework
nice to ear about it

I'll also have to do something like that to migrate data...

it would be nice if play would let you define different connection
string for certain models, that way you could issue the whole
migrating with jpa

saludos

sas

Morten Kjetland

unread,
Mar 30, 2011, 3:25:59 AM3/30/11
to play-fr...@googlegroups.com

At work we also need multiple datasources.

This would be a nice new feature.

-morten

On Mar 30, 2011 4:26 AM, "sas" <ope...@gmail.com> wrote:

sas

unread,
Mar 31, 2011, 2:13:39 AM3/31/11
to play-framework
hey, may be we could develop a request features page and let people
vote on them...

On 30 mar, 04:25, Morten Kjetland <morten.kjetl...@gmail.com> wrote:
> At work we also need multiple datasources.
>
> This would be a nice new feature.
>
> -morten
> On Mar 30, 2011 4:26 AM, "sas" <open...@gmail.com> wrote:

Morten Kjetland

unread,
Apr 1, 2011, 11:53:27 AM4/1/11
to play-fr...@googlegroups.com

Alex Gran

unread,
Apr 8, 2011, 12:43:23 PM4/8/11
to play-framework
Must be a basic qs: How can I initialize spring jdbc 'bean.xml' in the
Play! app while its being started or before the first request ? where
is the hook ?

I'm sure this is not the forum for this next qs, but, is spring
transaction (PlatformTransactionManager) thread safe ? can I use a
single transaction manager across different threads/request? as long
as TransactionStatus object is not shared.

Many thanks

The Dave

unread,
Apr 8, 2011, 3:37:48 PM4/8/11
to play-framework
You can probably do this in a OnApplicationStart job. See
http://www.playframework.org/documentation/1.1/jobs

--Dave

Jaime Hablutzel Egoavil

unread,
Aug 20, 2014, 5:18:51 AM8/20/14
to play-fr...@googlegroups.com
Just to mention you can get a "java.sql.Connection" by calling static method "play.db.DB#getConnection()" from any controller/action and if I'm not wrong that's what you need to use Spring JDBC.
Reply all
Reply to author
Forward
0 new messages