|
|
Display Database Column name in java - JSP/Java
|
Views : 667
|
|
Tagged in : JSP-Java
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
The Below code will display the column names in a table.
PreparedStatement pre = conn.prepareStatement("select * from tb_1");
ResultSet res = pre.executeQuery();
ResultSetMetaData rsMetaData = res.getMetaData();
int cals = rsMetaData.getColumnCount();
for (int i = 1; i < cals + 1; i++) {
String columnName = rsMetaData.getColumnName(i);
out.println(columnName);
}
|
|
By Vinoth, On - 2010-02-02 |
|
|
|