Yes, I've been down that road - the problem with functions is that my data
sources are generated twice -- during the registration (?) and actual
invocation of the table-valued function that wraps my POJOs.
Re: stored procedures; One of the constraints in my application is that the
SQL must be simple; meaning, I cannot issue "select * from
CALL('my_sp_here')" nor can I do "select * from myfunction()" as the driver
will be adapted by query tools that impose a typical "select <columns>
from <tables> where <conditions>" syntax. (even if I could get around
syntax, the double-query that happens on my datasource via java functions
is too costly).
TableEngine lends itself best to this, but because I need to pre-process
parts of the query, having access to the Parser tree and thus the
expression conditions, visible select columns, etc, would make life
easier. Still, the hooks I have today work OK in
Select.queryWithoutCache() so I'll probably just go down that road.
Thanks for your input.
On Tue, Aug 7, 2012 at 4:48 AM, Noel Grandin <[email protected]> wrote:
> You'll probably have more joy interfacing to your custom CMS using java
> functions, and exposing those java functions to the H2 engine as fake
> tables using stored procedures.
>
> http://www.h2database.com/**html/features.html#user_**defined_functions<http://www.h2database.com/html/features.html#user_defined_functions>
>
> See the section marked "Using a function as a table".
>
>
> On 2012-08-06 16:49, Atul Chowdhury wrote:
>
>> Hi Thomas -
>> I'm querying a proprietary database which stores its data in an
>> object-tree (fields and collections make up its content). There's no way to
>> "query" this data structure other than use the Java APIs that come with the
>> database (the best way to explain the database is a "content management
>> system" type repository).
>> My intention is to use H2 as a JDBC driver and NOT a database. The
>> database is the repository I just mentioned, I just want to pass-thru the
>> results from repository->H2 driver -> client. This is why I'm building
>> transient tables via TableEngine and creating/disposing results immediately
>> (I could cache later on, but that complexity is not something I need to
>> address right now).
>> The alternative is to implement the JDBC specification for my purpose but
>> H2 already accomplishes this so well.
>> Let me know if this makes sense -
>> Atul
>>
>>
>>
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.