Code:
select '"sl"','"quantity"','"price"' union all select sl,quantity,price into outfile 'C:/file.txt' fields terminated by ',' lines terminated by '\r\n' from table
Code:
Statement st = con.createStatement(); String query = "select '"sl"','"quantity"','"price"' union all select sl,quantity,price into outfile 'C:/file.txt' fields terminated by ',' lines terminated by '\r\n' from "+table+""; ResultSet rs = st.executeQuery(query);
Comment