Text Size: Normal / Large

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();


User Comments

No comments could be found for this page.

New comments cannot be added to old documentation versions.

Privacy Policy | Project hosted by our server sponsors. | Designed by tinysofa
Copyright © 1996 – 2009 PostgreSQL Global Development Group