siena-jdbc - How can a raw SQL query be executed?

99 views
Skip to first unread message

Erin Drummond

unread,
Dec 12, 2012, 2:17:49 AM12/12/12
to siena-...@googlegroups.com
Hello,

How can I execute a raw SQL query using siena-jdbc? I basically need to do a "SELECT AVG(column) WHERE (condition)" kind of query which I cant figure out how to do using Siena's API. How can I get a handle on Siena's current PersistenceManager object and obtain a JDBC Connection object from it?

Thanks,
Erin

Pascal Voitot Dev

unread,
Dec 12, 2012, 2:35:19 AM12/12/12
to siena-...@googlegroups.com
Hi,

Siena is not really made to perform raw requests as it tries to target SQL and NoSQL
I thought about it but I think this would definitely pervert siena which is already hitting a really huge functional scope.
So for raw SQL, you should use JDBC directly.
You can get the PersistenceManager using getPersistenceManager().
Then you should cast it to a JdbcPersistenceManager.
Finally use getConnectionManager().getConnection() to retrieve a JDBC connection.

best regards
Pascal

PS: FYI, I don't maintain Siena anymore

On Wed, Dec 12, 2012 at 8:17 AM, Erin Drummond <erin...@gmail.com> wrote:
SQL

Erin Drummond

unread,
Dec 12, 2012, 2:39:24 AM12/12/12
to siena-...@googlegroups.com
Hi Pascal,

Thanks for your reply. Raw JDBC will suit me fine, I just wanted to leverage the fact that Siena has already read the connection info and set up a connection.

Also, I am aware that you don't maintain Siena anymore (I guess that means that nobody maintains it anymore?) but I have yet to find a better database wrapper for Play! 1.2.5 (Hibernate is retarded and overly complex, Ebean has poor integration and Siena is nice and simple and works great)


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

Pascal Voitot Dev

unread,
Dec 12, 2012, 2:46:45 AM12/12/12
to siena-...@googlegroups.com
Hi,
Gabriele provided a few help some weeks ago.
But yes nobody maintains it anymore.
Anyway, it's quite simple so it works quite well and you can correct bugs quite easily if you need it so I don't see any pb for going on using it if it fits your needs ;)

best regards
Pascal
Reply all
Reply to author
Forward
0 new messages