Mittwoch, 11. Juli 2007
Drop all tables
We tried to deploy an application to a customer’s test system yesterday and needed to clean up the full database. We agreed before that they have to delete the schema and the user with all table etc. but they missed to notify their ORACLE adminstrators. We had only the permissions to work in, but not with the schema. So how to drop a few hundred tables?
DROP TABLE * CASCADE CONSTRAINTS!?
No. No such statement is possible. The solution of my workmate was a little funny:
DROP TABLE * CASCADE CONSTRAINTS!?
No. No such statement is possible. The solution of my workmate was a little funny:
- Open ORACLE SQL Developer and connect to the database / schema.
- Mark all tables to delete.
- Choose “edit / copy full path” from the applications menu.
- Paste the stuff into the script editor. You get something like “TABLE MySchema.MyTable@MyDb”.
- Open Search/replace and replace “TABLE MySchema” with “DROP TABLE MySchema”.
- Replace also “@MyDb” with “ CASCADE CONSTRAINTS;”.
- Run the script.

Montag, 2. Juli 2007
Dynamic two dimensional array in Java
I need a dynamic two dimensional array in Java. I thought I might not be the only one, so I searched with regular search engines and the code searches. Surprisingly I did not find any free implementation. I thought this would be a such common case, that the JRE or at least the Jakarta Commons Collections might contain it. No, they do not.
It seems the rest of the world builds their own implementation or uses the javax.swing.table.TableModel and javax.swing.table.DefaultTableModel. The public API of the latter gets near to what I want, but it’s not exactly what I was looking for.
I thought about something like this:
It seems the rest of the world builds their own implementation or uses the javax.swing.table.TableModel and javax.swing.table.DefaultTableModel. The public API of the latter gets near to what I want, but it’s not exactly what I was looking for.
I thought about something like this:
interface TwoDimensionalArray<T>
{
T set(int x, int y, T value);
boolean add(int x, int y, T value);
T get(int x, int y);
Iterator<Iterable<T>> iterator();
boolean isEmpty();
/** returning the overall element count */
int size();
}
Geschrieben von Jörg
in Softwaretechnik
um
08:02
| Kommentare (0)
| Trackbacks (0)
Tags für diesen Artikel: java, open source
(Seite 1 von 1, insgesamt 2 Einträge)


Jörg bei Twitter

