String createSQL = "CREATE TABLE testNvl2(id BIGINT, txt1 varchar, txt2 varchar, num number(9, 0));";
stat.execute(createSQL);
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(1, 'test1', 'test2', null)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(2, null, 'test4', null)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(3, 'test5', null, null)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(4, null, null, null)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(5, '2', null, 1)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(6, '2', null, null)");
stat.execute("insert into testNvl2(id, txt1, txt2, num) values(7, 'test2', null, null)");
String query = "SELECT NVL2(txt1, txt1, txt2), txt1 FROM testNvl2 order by id asc";