Thread: Html output
I know when you use psql you can set the output of a query to html with a "\H". Is there a way in Java's JDBC to instruct postgres to return it's results in this format? If not, can I set postgres up to use html as it's default response to queries? If I can get this to work all I need to do inside my program is send the result to the PrintWriter and display the result.
On Fri, 2003-02-07 at 05:30, Molenda, Mark P wrote: > I know when you use psql you can set the output of a query to html with a > "\H". Is there a way in Java's JDBC to instruct postgres to return it's > results in this format? If not, can I set postgres up to use html as it's > default response to queries? If I can get this to work all I need to do > inside my program is send the result to the PrintWriter and display the > result. No. This form of output is provided by psql, not by PostgreSQL itself. Regards, Andrew. -- --------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Survey for nothing with http://survey.net.nz/ ---------------------------------------------------------------------
On Thu, 6 Feb 2003, Molenda, Mark P wrote: > I know when you use psql you can set the output of a query to html with > a "\H". Is there a way in Java's JDBC to instruct postgres to return > it's results in this format? If not, can I set postgres up to use html > as it's default response to queries? If I can get this to work all I > need to do inside my program is send the result to the PrintWriter and > display the result. ---------------------------(end of > broadcast)--------------------------- TIP 4: Don't 'kill -9' the > postmaster > -- Antti Haapala +358 50 369 3535 ICQ: #177673735
On Thu, 6 Feb 2003, Molenda, Mark P wrote: > I know when you use psql you can set the output of a query to html with a > "\H". Is there a way in Java's JDBC to instruct postgres to return it's > results in this format? If not, can I set postgres up to use html as it's > default response to queries? If I can get this to work all I need to do > inside my program is send the result to the PrintWriter and display the > result. The HTML rendering is provided by C client library, which psql also uses. There's no way of forcing the backend to send query results in HTML. I'm not familiar with JDBC though. It may offer such a functionality. -- Antti Haapala