Re: [INTERFACES] JDBC query...

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Mark Dzmura <mdz(at)phalanx(dot)phalanx(dot)net>
Cc: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [INTERFACES] JDBC query...
Date: 1999-08-16 13:43:32
Message-ID: Pine.LNX.4.10.9908161438350.19435-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Thu, 12 Aug 1999, Mark Dzmura wrote:

> Folks:
>
> I would like to extend my (JDBC-using) software to be able to present
> the user with a list of available databases from a chosen database
> server, to create new databases, and to create new tables...
>
> My reading of the JDBC 1.0 and 2.0 specs presents a picture of an API
> which seems to be of a "read only" nature regarding database metadata
> - I can't find ways to create, delete, and modify above the level of
> SQL queries against tables...
>
> In that regard, my questions address both JDBC itself, and the
> Postgres JDBC driver implementation.
>
> Regarding JDBC,
>
> 1. Is there an object of higher "scope" than the Connection object,
> which is bound to a specific database??

No. Connection is created by Driver when a connection is made, and
everything else runs from under it.

> 2. Is there a Database object, which provides methods to create,
> destroy, and modify the schemas of tables ?? Or can I do SQL "CREATE
> TABLE" and "DROP TABLE" operations using some version of Statement
> which doesn't return a ResultSet ??

You can use either Statement or PreparedStatement to create tables. You
use the executeUpdate() method, as it doesn't return a ResultSet.

The basic example included with the source creates and drops some tables
in this way.

> Finally, at what level does the Postgres JDBC driver support JDBC
> (regarding my questions and in general) ??

We support the basic parts of both JDBC 1.2 and JDBC 2.0 specs. There is a
lot more to be implemented, but it's currently done on a first come or
spare time basis.

Peter

--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 1999-08-16 14:24:16 Re: [INTERFACES] fe_setauthsvc: invalid name. Ignoring... ERROR
Previous Message Peter Mount 1999-08-16 12:07:37 Re: [PATCH] PostgreSQL JDBC