public static void dropPrimaryKey ( Connection conn , String table ) throws SQLException { String update = "ALTER TABLE " + table + " DROP PRIMARY KEY" ; PreparedStatement stmt = null ; try { stmt = conn . prepareStatement ( update ) ; if ( stmt . executeUpdate ( ) == 1 ) { log . info ( "Database primary key removed from '" + table + "'." ) ; } } finally { close ( stmt ) ; } }
Removes the primary key from the specified table .