pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Listing Database
3+ messages / 3 participants
[nested] [flat]

* Listing Database
@ 2004-07-02 18:21  Steven Bell <sfbell@keasdesign.net>
  0 siblings, 2 replies; 3+ messages in thread

From: Steven Bell @ 2004-07-02 18:21 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

I am starting out with the PostgreSQL JDBC and I was wondering how to 
get a list of the databases. I know from the psql command line, \l will 
do it. But how about within a Java app?

Thanks,
Steve.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Listing Database
@ 2004-07-02 18:33  Chris Smith <cdsmith@twu.net>
  parent: Steven Bell <sfbell@keasdesign.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Chris Smith @ 2004-07-02 18:33 UTC (permalink / raw)
  To: Steven Bell <sfbell@keasdesign.net>; pgsql-jdbc

Steven Bell wrote:
> I am starting out with the PostgreSQL JDBC and I was wondering how to
> get a list of the databases. I know from the psql command line, \l
> will do it. But how about within a Java app?

Just a guess, but you might connect to a database that you know is there
(template1?) and call DatabaseMetaData.getCatalogs().  Does that work?

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Listing Database
@ 2004-07-02 18:50  Franco Bruno Borghesi <franco@akyasociados.com.ar>
  parent: Steven Bell <sfbell@keasdesign.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Franco Bruno Borghesi @ 2004-07-02 18:50 UTC (permalink / raw)
  To: Steven Bell <sfbell@keasdesign.net>; +Cc: pgsql-jdbc

what if you just execute the query "select datname from pg_database" in
a Statement and iterate the ResultSet?


On Fri, 2004-07-02 at 15:21, Steven Bell wrote:

> Hello,
> 
> I am starting out with the PostgreSQL JDBC and I was wondering how to 
> get a list of the databases. I know from the psql command line, \l will 
> do it. But how about within a Java app?
> 
> Thanks,
> Steve.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

Attachments:

  signature.asc (application/pgp-signature, 186B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-07-02 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 18:21 Listing Database Steven Bell <sfbell@keasdesign.net>
2004-07-02 18:33 ` Chris Smith <cdsmith@twu.net>
2004-07-02 18:50 ` Franco Bruno Borghesi <franco@akyasociados.com.ar>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox