I am trying to fetch the values from testcase table but its throwing java.sql.SQLException: Illegal operation on empty result set and Here is my code,
try {
tcID=con.prepareStatement("select tc_id,tc_name from testcase where project_id=? and tc_id=? ");
tcID.setString(1,project);
tcID.setString(2,tciD);
ResultSet rs = tcID.executeQuery();
System.out.println("Loop TC ID....."+rs.getString("tc_id"));
System.out.println("Loop TC Name......"+rs.getString("tc_name"));
while(rs.next()){
System.out.println("Inside While.....");
ps = con.prepareStatement("insert into execution_testcases (project_id, Rel_id, testcase_id, testcase_name, Flag) values(?,?,?,?,?)");
ps.setString(1, project);
ps.setString(2, RelName);
ps.setString(3, rs.getString("tc_id"));
ps.setString(4, rs.getString("tc_name"));
ps.setString(5, "true");
ps.executeUpdate();
}
String cmd= "java -jar D:\\FrameworkCodeDev\\Backups\\WebDriverJarFiles\\Build Release\\Framework_TAF_V10.jar";
Runtime.getRuntime().exec(cmd);
} catch (SQLException e) {
e.printStackTrace();
}
Thanks.