Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- GroovyShell shell = new GroovyShell();
- String script = "";
- script = ""
- + "def url ='jdbc:oracle:thin:@localhost:1521:XE';"
- + "def user = 'x';"
- + "def pass= 'X';"
- + "def driver = 'oracle.jdbc.pool.OracleDataSource';"
- + "def sql = groovy.sql.Sql.newInstance(url, user, password, driver); "
- + "sql.eachRow('select id from dec_rt_decision'){"
- + "it-> println('My row number is: ${it.count}');"
- + "};"
- + "sql.close();"
- + "println(result);";
- shell.evaluate(script);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement