Bah, whatever, this in a Groovy step works just as well:
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.*;
try
{
Connection con=null;
ResultSet rs = null;
String output;
Class.forName("oracle.jdbc.driver.OracleDriver");
//Get connected to database
con=DriverManager.getConnection(
"jdbc:oracle:thin:@machine_name:1521:database_name",
"USERNAME",
"PASSWORD");
Statement s=con.createStatement();
//The SQL to execute
rs = s.executeQuery("select COUNT(*) from TABLE");
//doing one "next" to set the cursor on the first element
rs.next();
//output results until resultset is out of elements
while(!rs.isAfterLast())
{
//Get's the data from Xth column of this row in the resultset
//ex: select dude,sweet from wherecartable
//rs.getString(1) gets data from dude and rs.getString(2) gets data from sweet
output = rs.getString(1);
log.info(output);
rs.next();
}
s.close();
con.close();
}
catch(Exception e)
{
e.printStackTrace();
}