You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Gerhard Froehlich <g-...@gmx.de> on 2001/10/31 14:10:39 UTC

[AvalonDB] PreparedStatements

Hi,
just thinking about the AvalonDBPreparedStatement some 
questions are rising up:

PreparedStatement means pre-compiled. That means some object
will be generated and filled.

Simplified worded the client invokes the creation of PreparedStatement.
The SQL String will be transerferd to the PreparedStatement object. Now
something must happen. In my current understanding the BCELSQLParser creates
something dynamically. A SQL Object, or the final Request Object, I don't know. 
This object can be filled thru getter/setter methods and it's holded precompiled
in the JVM. When the excecuteQuery() or executeUpdate() methods are invoked 
this object will be taken and the SQL request will be executed. Everything
happens on the same connection, of course.

Comments, thoughts??

Cheers
Gerhard




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AvalonDB] PreparedStatements

Posted by Paul Hammant <Pa...@yahoo.com>.
Gerhard,

>just thinking about the AvalonDBPreparedStatement some 
>questions are rising up:
>
>PreparedStatement means pre-compiled. That means some object
>will be generated and filled.
>
True, but given that SQL will be morphed into bytecode by the BCELParser 
and cached.  Subsequently hooking into it "?, ?, ?" style will be easy.

>Simplified worded the client invokes the creation of PreparedStatement.
>The SQL String will be transerferd to the PreparedStatement object. Now
>something must happen. In my current understanding the BCELSQLParser creates
>something dynamically. A SQL Object, or the final Request Object, I don't know. 
>This object can be filled thru getter/setter methods and it's holded precompiled
>in the JVM. When the excecuteQuery() or executeUpdate() methods are invoked 
>this object will be taken and the SQL request will be executed. Everything
>happens on the same connection, of course.
>
So the Reply for the preparation has to hand back a munged reference 
that subsequent executeUpdate() can use.  The Connection (or something) 
would reference it on the client side.

Regards,

- Paul H


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>