Utility method from David Hoover.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2258 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
zell
2007-11-20 19:06:18 +00:00
parent b3cabed72a
commit 8074cba636
@@ -438,6 +438,21 @@ public class JDBCUtil
}
}
/**
* Returns a string representation of the default value for the specified column in the
* specified table. This may be null.
*/
public static String getColumnDefaultValue (Connection conn, String table, String column)
throws SQLException
{
ResultSet rs = getColumnMetaData(conn, table, column);
try {
return rs.getString("COLUMN_DEF");
} finally {
rs.close();
}
}
/**
* Adds a column (with name 'cname' and definition 'cdef') to the specified table.
*