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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user