This page in other versions: Unsupported versions: 7.2 / 7.3 / 7.4

5.5. Creating and Modifying Database Objects

To create, modify or drop a database object like a table or view you use the execute() method. execute is similar to the executeQuery() used to issue a select, however it doesn't return a result.

Example 5-3. Drop Table Example

This example will drop a table.

Statement st = db.createStatement();
ResultSet rs = st.executeQuery("DROP TABLE mytable");

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group