[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resultset...



Hello all...
 
Scenario:
...
String selectCaseQuery = "Select * from " + dbTableName + " order by " + caseNoName;
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery();
...
 
My question is, when retrieving the resultset is it possible to specify a variable in the getString methods of Resultset:
For instance:
 
...
while(rs3.next()){
     System.out.println(rs3.getString("\"" + caseNoName + "\""));  //I have tried this but to no avail, is there a workaround!?
 }
...

I have tried the above statement but it dosen't seem to work and i know why.  But is there some workaround.  When I ask my users for a columnName of the database they intend to use, I must specify that name in the getString methods. 
Any and all help is greatly appreciated!
 
jags