Hi All,
I wish to get the metadata information from database.I want to write my code independent of the database. I am using the following code...
String queryString = "select employeeName,address from employee where 1 = -1"
ResultSetMetaData rsmd = null;
rs = stmt.executeQuery(queryString);
rsmd = rs.getMetaData();
rsmdSize = rsmd.getColumnCount();
for(int i = 1;i <= rsmdSize;i++){
System.out.println("the col types " + rsmd.getColumnTypeName(i) );
System.out.println("the Size types " + rsmd.getColumnDisplaySize(i));
}
There is a drawback in this, that select statement will search the full table for fetching the data bcoz the where clause is "where 1 = -1"
As if the employee table consist of billion records it will take lot of time.
Can anyone guide me how to get the details through resultset without searching the full table?