Patch for allowing jdbc to log sql queries

From: Deepak Bhole <dbhole(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Patch for allowing jdbc to log sql queries
Date: 2003-09-24 05:50:42
Message-ID: 1064382642.13508.34.camel@zion
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Hi,

This patch allows JDBC to log SQL queries that are being sent to the
backend (including prepared/callable statements). It can be quite useful
when writing/debugging java applications that rely on dynamic queries.

The log is sent to the standard log stream managed by the DriverManager.
It can be enabled by adding a ?logtype=X to the URL. X, specifies the
type of statement to log. Currently, only type "all" is supported i.e.
log all statements going to the backend. The logging can also be turned
on/off by calling [enable|disable]SQLLogType(int type).

Also, since variable length is prepares/callable statements can be too
large, the number of characters of the variable value to be displayed
can be adjusted via setMaxSQLLogVarLen(). There is a upper limit of 256
and a lower limit of 32 characters.

Deepak

--
Deepak Bhole <dbhole(at)redhat(dot)com>
Red Hat Canada Ltd.

Attachment Content-Type Size
diff.patch text/plain 11.9 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message Chris Faulkner 2003-09-24 06:46:28 Re: [CYGWIN] authentication
Previous Message Frank Seesink 2003-09-24 02:46:47 Re: authentication