Agile Development. more fun. less stress.

Oracle Snippets Part 1 – How to clear a schema in Oracle

This script deletes all user objects in a schema (Tables, views, procedures, dblinks, etc…) without dropping the user.

SQL Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
conn test/test

set head off
set pagesize 0
set verify off
set feedback off

select 'drop '||object_type||' '|| object_name||  DECODE(OBJECT_TYPE,'TABLE',' CASCADE CONSTRAINTS;',';')
from user_objects

spool drop_objects.sql
/
spool off

@drop_objects.sql

original source: https://community.oracle.com/thread/328462

The Java EE Paranoia

Hello,

if you – like me – are tired of hearing “we can’t use spring because it’s not Java EE Standard”. Then have fun with this article on heise.de

The article is written in german so I’ll sum it up to the point:

Many enterprises use nothing but Java EE because they assume that it’s stable and will be continuously developed further for many more years. They rely on their application servers and Java EE landscape so badly it seems like paranoia for me sometimes. (Or like 5 apes in a cage)

Therefore it’s very interesting to see that Oracle is removing their resources from Java EE and the JCP (Java Community Process), in favour of their cloud business.

Many developers already brought up the idea to fork JavaEE but we all see what Oracle an Google are pulling of right now in their Java API lawsuit…

cheers.

JUnit Snippets Part 1 – The Temporary Folder Rule

The TemporaryFolder Rule is the easiest way to create a temporary folder in your JUnit tests.

Available since JUnit 4.7

The following code snippet was taken from the JUnit API docs.

1
2
3
4
5
6
7
8
9
10
11
public static class HasTempFolder {
  @Rule
  public TemporaryFolder folder = new TemporaryFolder();

  @Test
  public void testUsingTempFolder() throws IOException {
      File createdFile = folder.newFile("myfile.txt");
      File createdFolder = folder.newFolder("subfolder");
      // ...
     }
 }