Files
2020-06-30 14:58:21 +08:00

776 B

layout, title, header, resource, previoustitle, previous, nexttitle, next
layout title header resource previoustitle previous nexttitle next
default_docs Creating and Modifying Database Objects Chapter 5. Issuing a Query and Processing the Result media Performing Updates update.html Using Java 8 Date and Time classes java8-date-time.html

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 5.4, “Dropping a Table in JDBC illustrates the usage.

Example 5.4. Dropping a Table in JDBC

This example will drop a table.

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