I'm using J2EE and my code is below
public class Notifier {
private Connection conn;
public void notifyThread() throws SQLException {
conn = ConnectionManager.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("NOTIFY notificationRecived");
stmt.close();
}
}
At the listener's end I'm using:
org.postgresql.PGNotification notifications[] = pgconn.getNotifications();
To extract the details of notification. Here I noticed that
notifications[i].getParameter();
Is a method to extract the data which is sent along with the NOTIFY statement.
I saw few threads which suggest that we can pass data along with the NOTIFY statement like NOTIFY notificationRecived, "xyz"
but this one throws an error at ,xyz.
Is there any other syntax to pass parameters along with NOTIFY?