Search Postgresql Archives

Re: LISTEN/NOTIFY with JDBC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux