![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e245. Creating a Database TableThis example creates a table calledmy_table with one column,
col_string , which holds strings.
try { Statement stmt = connection.createStatement(); // Create table called my_table String sql = "CREATE TABLE my_table(col_string VARCHAR(254))"; stmt.executeUpdate(sql); } catch (SQLException e) { }
e247. Listing All Table Names in a Database e248. Creating a MySQL Table to Store Java Types e249. Creating an Oracle Table to Store Java Types e250. Creating a SQLServer Table to Store Java Types © 2002 Addison-Wesley. |