I want to shift the value in columns after comparision. I am having problem with the getString command. It results in an error ….my code is like this
for(p=1;p<20;p++)
{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/srch","root","");
Statement stmt2=con.createStatement();
ResultSet rs2=stmt2.executeQuery("select * from "+tbl+"c"+startc+" where keyword='"+sk[i]+"'");
cnt=0;
if(rs1.findColumn("count"+p) > 0)
{
System.out.println("count"+p);
cnt=rs2.getInt("count"+p);
if(cnt > (occ+1))
{
}
else if(cnt < (occ+1))
{
q=p;
break;
}
else
{
continue;
}
con.close();
}