db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: Questions concerning the implementation
Date Tue, 15 Dec 2009 03:42:30 GMT
mkoendling <m_koendl@yahoo.de> writes:

> hi derby team,
>
> I already posted some of my questions concerning the implementation of jdbc
> in the user list: 
> http://old.nabble.com/Questions-about-the-implementation-to26689131.html
>
> I guess one of my problems is to figure out where the jdbc-driver starts and
> where it ends.  Is it correct to say that the jdbc-driver of derby (embedded
> or client) is quite intertwined with the whole engine? Or perhaps, is the

The embedded driver does, of course, make calls on the Derby engine,
but the driver code is fairly well separated out, cf. the directory

java/engine/org/apache/derby/impl/jdbc

For example, EmbedResultSet.java:

  public abstract class EmbedResultSet extends ConnectionChild 
      implements EngineResultSet, Comparable {

implements java.sql.Resultset (through implementation of the the
interface EngineResultSet).

> jdbc-driver the whole engine? 

No, that is not a fair statement.

>
> My second question concerns ResultSets. How is the data actually fetched in
> Client-Server mode. Is the whole ResultSet loaded into one Object/Table/...
> and sent over the network? Is there some kind of cache for the ResultSet and
> subsequent rows are loaded dynamically?... . 

The client does prefetch rows, but will ask for more rows when the
cache is empty. The server will then use JDBC API (and hence the
embedded driver) to get more rows from the engine and return them to
the client, see Cursor.java/NetCursor.java. The client driver uses the
DRDA protocol [1], which can make the code a bit hard to understand at
first. I suggest running a debugger to get a feel for the dynamic
structure of the code.

[1] http://en.wikipedia.org/wiki/DRDA

Hope this helps a bit.

Dag

Mime
View raw message