But first, are you intending to use JPA, or do you want to execute your own queries using a JDBC connection by hand?
My current solution (desktop app and servlet) both use a mechanism not unlike hibernate but of my own design which uses sql statement from a xml document and executes those. It can handle mySQL, Oracle or SQL Server and picks the appropriate sql syntax as needed.
If I could use my existing solution I would prefer to do that - but I am rather unclear as to the lifecycle of the current code, the entry point, the sequence of calls, where the execution branches when there is an exception and so forth.
I would like to know where I would put my jdbc database "connection" and "close" code - the only place I can see at the moment is within each @POST @GET method - but that seems awfully inefficient - opening and closing all the time.
I realise all these Annotations are supposed to make life easier - when you know what and when to use them all - but I'm used to knowing what's going on behind the scenes and this "abracadabra" approach to making it work with little real java code is worrying me a bit.
Dave