select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 7.4 / 7.3 / 7.2
Historical version. PostgreSQL 7.4 reached end of support in October 2010. See the current manual for supported releases.

31.6. Creating and Modifying Database Objects

To create, modify or drop a database object like a table or view you use the execute() method. This method is similar to the method executeQuery(), but it doesn't return a result. Example 31-7 illustrates the usage.

Example 31-7. Dropping a Table in JDBC

This example will drop a table.

Statement st = db.createStatement();
st.execute("DROP TABLE mytable");
st.close();

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.