21.05.2014 Views

Android & PostgreSQL (application/pdf - 311.5 KB) - PGCon

Android & PostgreSQL (application/pdf - 311.5 KB) - PGCon

Android & PostgreSQL (application/pdf - 311.5 KB) - PGCon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LISTEN: Dummy query<br />

Need to issue a dummy query to contact the <strong>PostgreSQL</strong> database before any<br />

pending notifications are received:<br />

while ( true ) {<br />

try {<br />

Statement stmt = conn . c r e a t e S t a t e m e n t ( ) ;<br />

R e s u l t S e t r s = stmt . executeQuery ( ”SELECT 1 ; ” ) ;<br />

r s . c l o s e ( ) ;<br />

stmt . c l o s e ( ) ;<br />

. . .<br />

markwkm (<strong>PGCon</strong>2011) <strong>Android</strong> & <strong>PostgreSQL</strong> 20 May 2011 20 / 37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!