I am trying to get table primary key columns from a ResultSet. Following are the steps
I followed:
1. SQL QUERY: Select id,subid,email,empname from Employee
2. Executed this from java.sql.Statement and got the Results in ResultSet.
Here is the interesting part.
3. ResultSetMetadata rsmd = rs.getMetadata();
Now, if I look at this rsmd variable , it displays primary key flags for the corresponding column names, but I cannot access it or get it in any variable.
I need help regarding the same.
NOTE. I do not want to use DatabaseMetadata and its getPrimaryKeys () function, since it adds an add to the external database. In addition, the ResultSetMetadata object already has a primary key. Information I just need to extract.