You should be fine just allocating a PreparedStatement on the connection object 
that gets passed to the function.
H2 caches plans internally based on the query string anyway.

But if you really want to, you can call
  DriverManager.getConnection("jdbc:default:connection")

But note that you'll have to enable this feature by adding 
";DEFAULT_CONNECTION=TRUE" to your H2 URL.

On 2014-08-18 08:31 PM, Brian Craft wrote:
Managing prepared statements, which are allocated per-connection.

On Sunday, August 17, 2014 11:22:38 PM UTC-7, Noel Grandin wrote:

    Your question has already been answered, if you read the linked docs 
carefully, but why exactly are you trying to get
    the original connection anyway?

    The new connection passed to the function shares the same underlying 
session as the original connection, so it shares
    the same transactional boundaries etc, etc, so there generally is no need 
to get a handle on the original connection.

--
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
h2-database+unsubscr...@googlegroups.com 
<mailto:h2-database+unsubscr...@googlegroups.com>.
To post to this group, send email to h2-database@googlegroups.com 
<mailto:h2-database@googlegroups.com>.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

--
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to