Re: how to monitor the amount of bytes fetched in a executeQuery()

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Albert Cardona <acardona(at)ini(dot)phys(dot)ethz(dot)ch>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: how to monitor the amount of bytes fetched in a executeQuery()
Date: 2006-07-12 22:14:14
Message-ID: 44B57436.9040308@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Albert Cardona wrote:

> I will have a look at the code myself but I'm not familiar with it -you say
> it's at PGconnection class?

org.postgresql.PGConnection is our extension interface that applications
use to get access to driver-specific features. The actual implementation
would go in AbstractJdbc2Connection which would delegate to the
protocol-level code in org/postgresql/core/* to get stats from the
underlying connection. Looks like you may need to play with PGStream so
it actually tracks the byte count, unless one of the wrapping streams
already does that.

app code would look something like this:

Connection c = /* get connection */;
if (c instanceof PGConnection) {
PGConnection pgc = (PGConnection)c;
long byteCount = pgc.getInputByteCount(); // or whatever
}

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Folorunsho, Abayomi 2006-07-13 10:14:49 CLASS EXCEPTION org.postgresql.Driver
Previous Message Albert Cardona 2006-07-12 22:00:00 Re: how to monitor the amount of bytes fetched in a executeQuery()