Columns
Use the getMetaData method to retrieve the metadata about a table or view. Table metadata includes the column names, data types, table key information, and other fields that the driver uses to interact with the data source. The technique below is used to select all of the columns from Account:
DatabaseMetaData table_meta = conn.getMetaData();
ResultSet rs = table_meta.getColumns(null, null, "Account", null);
while(rs.next()){
System.out.println(rs.getString("COLUMN_NAME"));
System.out.println(rs.getString("TYPE_NAME"));
System.out.println(rs.getString("COLUMN_SIZE"));
}