Since there is a lot of stored procedure invocations in my current project (on Oracle db) I decided to isolate a dedicated component for completing this task.
The project is called JProcedure and being hosted on google code at the moment: http://jprocedure.googlecode.com
There is no wiki documentation right now (examples are being creted), but the api docs and the source itself should be enough.
The basic concept for this project was to simplify stored procedure invocations from java code (which can be a pain in the *** sometimes) by leveraging java annotations.
The only thing you have to do is annotate a class that represents stored procedure definition and then annotate any method that reflects a stored procedure. For transforming the statement output you will have to write your custom ResultTransformer and that's it.
The engine supports automated caching (which you can turn on and off using annotations) and custom invocation interceptors that allow you to add additional logic before and after a stored procedure call.
1. There is only Oracle support implemented at the moment, but supporting other db vendors is just a matter of implementing a single StatementBuilder interface.
2. The Connection object is being obtained from JNDI given a DataSource path and does not support caching Datasource object - this will be enchanced to support different ways of obtaining a connection
3. There is no specific exception handling policy (on to do list)
4. Caching is done by using simple Map which is very, very bad. There will be support for different caching utilities (ehcache, jboss cache, etc).
5. No transaction management which means you have to use the component in transactional context (To be done)
The engine works and occured to be extremely handy, hence the decision of open-sourcing it.
If you find few spare minutes and take a look at what has been done so far, I will very much appreciate any positive and negative feedback.
Once again: http://jprocedure.googlecode.com
Thanks in advance