Hi Jazarine,

I'm assuming you need to get the LCC once you are in the execute phase, and in a class implementing ResultSet. All the different ResultSet implementations in org.apache.derby.impl.sql.execute get an activation supplied to their constructor either directly, or through its source/child ResultSet. It should hence be available either:
- as a member of the given ResultSet class
- though the ResultSets source/child ResultSet
- through getLanguageConnectionContext()
- or through getActivation().getLanguageConnectionContext()
depending on the ResultSet class implementation you are in.

It could be beneficial to have a look around ProjectRestrictNodeResultSet, the top-most ResultSet for a SELECT qry, and see how it's fetched/used?

Activations are created/built with an ActivationClassBuilder and is populated during the bytecode generation phase. You can see one example of how the ActivationClassBuilder is used in ProjectRestrictNode.generateMinion() in org.apache.derby.impl.sql.compile. ProjectRestrictNode is the node generating the ProjectRestrictNodeResultSet (and a few others for the sake of correctness). Generally we push objects to the stack, then call to ActivationClassBuilder to push generation of the correct type of ResultSet on the stack. This is where the actual Activation object is created, and as previously stated it's often pushed as a parameter to the ResultSet constructor. Once code generation is completed, we start executing the generated bytecode. Someone with a little more knowledge of the details may want to explain this further, or correct me, if necessary? :)

Hope this helps you figure it out :)

Thomas

Jazarine Jamal wrote:
I need to get the langaugeconnectioncontext.
I presume it can be done through this:

    LangaugeConnectionContext=activation.getLangaugeConnectionContext()

But How do I create an Activation object? Are there any implemented classes for Activation interface..?? I am doing this since it forms a part of the code to get the type of an object. Please get me some help as soon as possible..

Reply via email to