I have the following code:
package connectivity;
import java.sql.ResultSet;
import java.sql.Statement;
public class Connectivity {
public static void main(String[] args) {
cls o=new cls();
try{
Statement s=o.getct();
ResultSet rs;
rs=s.executeQuery("select * from REGISTRATION1");
while(rs.next()){
String st=rs.getString("FACULTY_ID");
String st2=rs.getString("STUDENT_ID");
}
}catch(Exception e){
System.out.println(e);
}
}
}
The output is:
java.sql.SQLException:
[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index"
Why?