How to get table name from a column
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abdulla_J
Posted On:   Monday, March 27, 2006 06:00 PM

Following code does not return table name. rather, it returns ""

ResultSet rs = st.executeQuery("select aCOLUMN from A_TABLE");
ResultSetMetaData rsm = rs.getMetaData();
int colCnt = rsm.getColumnCount();
while(rs.next()){
for (int i = 1; i <= colCnt; i++) {
String tableName = rsm.getTableName(i);
System.out.println("Table Name :"+tableName);
}
}

About | Sitemap | Contact