Hello, 

I'd like to use H2 to parse and execute prepared queries, without storing 
tables. These queries are quiete simple (without any join, order, sub 
queries, ...). 
Most of the time it is something like: 
- SELECT a = 2 and b = 5;
- SELECT CASE WHEN a = 2 and b = 5 THEN 1 ELSE 0 END;

Here is what I do to achieve it: 

1) Set up a database, session and H2 parser. 
Should I use "jdbc:h2:mem:" ?

2) Prepare queries : 
Format on my own prepared string queries. To do that I can use 
Parser.parseExpression() to explore the query and replace field names with 
'?'. 
Prepare the query : Parser.prepare()

3) Executing the queries with new parameters:
Set manually the parameters in the Prepared statement : Parameter.setValue()
Execute the query : Prepared.query(1)

This works fine. However I'd like to know what are the H2/system parameters 
to set in order to optimize the performances. 
I guess the following parameters could be useful to set:
MV_STORE, MVCC, MODE, MAX_MEMORY_ROWS, CACHE_SIZE, CACHE_TYPE=SOFT_LRU, ..

Regards,

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/5e1c16aa-950b-46ad-807f-c6a8444f2d3dn%40googlegroups.com.

Reply via email to