pg.ddx.io pgsql-interfaces@postgresql.org mailing list archivehelp / color / mirror / Atom feed
JDBC query... 3+ messages / 3 participants [nested] [flat]
* JDBC query... @ 1999-08-12 23:18 Mark Dzmura <mdz@phalanx.phalanx.net> 1999-08-15 15:17 ` Re: [INTERFACES] JDBC query... Herouth Maoz <herouth@oumail.openu.ac.il> 1999-08-16 13:43 ` Re: [INTERFACES] JDBC query... Peter Mount <peter@retep.org.uk> 0 siblings, 2 replies; 3+ messages in thread From: Mark Dzmura @ 1999-08-12 23:18 UTC (permalink / raw) To: pgsql-interfaces 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?? 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 ?? Finally, at what level does the Postgres JDBC driver support JDBC (regarding my questions and in general) ?? Thanks, Mark Dzmura -- )))) This email routed via a wireless gateway!! (((( ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] JDBC query... 1999-08-12 23:18 JDBC query... Mark Dzmura <mdz@phalanx.phalanx.net> @ 1999-08-15 15:17 ` Herouth Maoz <herouth@oumail.openu.ac.il> 1 sibling, 0 replies; 3+ messages in thread From: Herouth Maoz @ 1999-08-15 15:17 UTC (permalink / raw) To: Mark Dzmura <mdz@phalanx.phalanx.net>; pgsql-interfaces At 02:18 +0300 on 13/08/1999, Mark Dzmura wrote: >1. Is there an object of higher "scope" than the Connection object, which >is bound to a specific database?? A connection object is bound to one connection to a single database. If you want to create or delete databases, you have to connect to the PostgreSQL database named 'template1'. You will typically have a separate connection object for this. >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 ?? Yes, you can use statements such as CREATE TABLE, DROP TABLE, and any other DDL statement, by using the executeUpdate() method of Statement or PreparedStatement. Its name may suggest that it is only for UPDATE statements, but that's not true. It's for any query which is not expected to return a result set. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] JDBC query... 1999-08-12 23:18 JDBC query... Mark Dzmura <mdz@phalanx.phalanx.net> @ 1999-08-16 13:43 ` Peter Mount <peter@retep.org.uk> 1 sibling, 0 replies; 3+ messages in thread From: Peter Mount @ 1999-08-16 13:43 UTC (permalink / raw) To: Mark Dzmura <mdz@phalanx.phalanx.net>; +Cc: 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@retep.org.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 ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-08-16 13:43 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 1999-08-12 23:18 JDBC query... Mark Dzmura <mdz@phalanx.phalanx.net> 1999-08-15 15:17 ` Herouth Maoz <herouth@oumail.openu.ac.il> 1999-08-16 13:43 ` Peter Mount <peter@retep.org.uk>
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