Thursday, August 1, 2002 05:50 AM
Execute a "Create table" statement is a right way to proceed.
The SQL syntax is something like this:
CREATE TABLE table_name (field1 INT NOT NULL, field2 CHAR(2), field3 DATE);
Possible field type can change from DBMS to DBMS.
This code create a table with only a field in MySQL:
String sql = "CREATE TABLE Servizio (SER varchar(100))";
Statement st = connection.createStatement();
int result = st.executeUpdate(sql);
The integer "result" contains the number of records updated by the statement.