SQLExecutor { public ArrayList<String[]> execute(final String sql) throws Exception { if (sql.toLowerCase().startsWith("select")) return executeQuery(sql); else return executeUpdate(sql); } SQLExecutor(final String url, final String user, final String password); ArrayList<String[]> execute(final String sql); void close();  }
@Test public void testRDB() throws Exception { final SQLExecutor rdb = new SQLExecutor("jdbc:oracle:thin:@ final ArrayList<String[]> rows = rdb.execute("select * from chan_arch.chan_grp where eng_id=2"); for (String[] row : rows) { for (int i = 0; i < row.length; i++) { final String col = row[i]; if (i > 0) System.out.print(", "); System.out.print(col); } System.out.print("\n"); } }