db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject Re: DRDA confusion
Date Thu, 01 Nov 2007 16:58:15 GMT
Bryan Pendleton <bpendleton@amberpoint.com> writes:

>>> I'm trying to understand how the DRDA spec is implemented in the
>>> client driver and on the server. Specifically how to write and parse
>>> an SQLSTT command. 
> Hi Dyre,
> I'm afraid I don't have any particular advice; it seems like you
> are looking in the right places in the spec.
> One idea would be to pick some other, somewhat similar, DRDA command
> that *is* implemented, and step through the client and server code
> that implements it in your debugger, and figure out what wire formats
> get used, and then that should help in figuring out how to interpret
> what the spec says regarding the SQLSTT command.

Yes, that's more or less what I did. That's how I came up with the
formats that were actually used (and which Knut has explained in
another email). 

> But I have a more abstract question: do we need to care what wire
> formats are used? That is, since our client talks only to our server,
> and this is a brand new DRDA command (at least, for our code), there
> is no wire-incompatibility issue here. As long as you construct an
> operational implementation, do we have to care whether our internal
> wire format exactly matches the format intended by the DRDA spec?

I guess not. As pointed out by Knut the format in question allows you
to detect the encoding used for the string. In my particular case the
encoding is not relvant since the value will only be used internally
(to piggy-back session info), and the string value is
encapsulated in proper DRDA command headers. That said, it is probably
a good thing to follow existing practice as much as

I'm modeling this on what Øyvind Bakksjø did with
setQueryTimeout(). He encodes the timeout value in a dummy
statement. The string containing that statement
is encoded in one of the two formats, and then sent from the
client to the server as an SQLSTT, actually EXCSQLSET+SQLSTT. I'm
essentially trying to do the same thing, but I also supply the
optional RTNSETSTT parameter (class instance variable, in DRDA speak)
to EXCSQLSET, which allows me to add SQLSTTs to the reply going back
to the client. 

On the client there already are methods for writing
SQLSTTs, but on server (in DRDAConnThread and DDMWriter) there is no
such method, so I'm trying to figure out how to write one using the
primitives provided there. On the client side one ends up calling 
buildNOCMorNOCS(String string) but I can't really find a similar
method on the server side. The closest thing I found was
DRDAConnThread.writeVCMorVCS(String s), but to me it does not seem to
be doing the same thing...?


View raw message