On Wed, 12 May 2004, Glenn Sullivan wrote:
> Thanks for the response. I have been using Sun's JDBC.
> Do I take it that I need to create and use the Postgres
> JDBC to get the ability to do NOTIFY/LISTEN?
>
You have been using the JDBC API provided by Sun as a number of interfaces
(java.sql.*) which are implemented behind the scenes by the postgresql
JDBC driver in concrete classes. Listen/Notify is a postgresql extension
not covered in the standard java.sql.* API, so must cast the standard
interfaces to postgresql implementations so that you can access the
additional functionality provided.
For example when using the postgresql JDBC driver java.sql.Connection is
actually an instance of org.postgresql.PGConnection, so you can cast your
Connection to a PGConnection to use the notification API. Unfortunately
the PGConnection and other extensions are either poorly documented or
completely undocumented. Combining my example with a brief look at the
source code for PGConnection and PGNotification should hopefully get you
going.
Kris Jurka