Allow for a create table postamble.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1800 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-03-19 19:40:57 +00:00
parent 7739d75780
commit 843ce5cab4
+3 -2
View File
@@ -213,7 +213,7 @@ public class JDBCUtil
* table already exists. * table already exists.
*/ */
public static void createTableIfMissing ( public static void createTableIfMissing (
Connection conn, String table, String[] definition) Connection conn, String table, String[] definition, String postamble)
throws SQLException throws SQLException
{ {
if (tableExists(conn, table)) { if (tableExists(conn, table)) {
@@ -223,7 +223,8 @@ public class JDBCUtil
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
try { try {
stmt.executeUpdate("create table " + table + "(" + stmt.executeUpdate("create table " + table + "(" +
StringUtil.join(definition, ",") + ")"); StringUtil.join(definition, ",") + ") " +
postamble);
} finally { } finally {
close(stmt); close(stmt);
} }