jdbc DataBaseMetaData + oracle 10g + dbunit + username..

If you are using DBUnit as tool for set up test environment in your oracle 10g then you have to provide the username of course. Normally it isn’t case sensitive in most tools. The jdbc driver or sqlplus let you create connection with lower case. DBUnit ask the DataBaseMetaData to get the defined tables in the schema. Schema and username are the same in the oracle world. So in DBUnit the source is

DatabaseMetaData databaseMetaData = jdbcConnection.getMetaData();
ResultSet resultSet = databaseMetaData.getTables(null, schema, "%", tableType);

where tableType is the String[] {“table”}. with schema == username lower case i get in my oracle 10.2 db nothing back. With upper case username et voila! Don’t know if this is really an standard behaviour….