How to create a header from an sql select query in java
Hi
I have to create a header line from a select query and put it in an output file following the records from the query.
For example ,
the query looks like this:-
select name,room_no,cc1200,cc1201,cc1202,cc1203,cc1204,cc 1205 from student;
The header should look like this
name,room_no,00,01,02,03,04,05
I only need idea of what to use to get the header i want
once i have the query , is it good idea to use token with delimiter , (is this idea a good one)
or using split function is a good idea ?
The query returns records which will be put into a file, all these records should preceed with a header with the column names changed to name,room_no,00,01,02,03,04,05 ?
How do i split the query till " FROM " word , so that i can get only the column names .
Thank You In Advance