sql - Parsing MYSQL Insert statement -
i'm writing java tool parse sql queries in order table , columns details. parse select
statement use mysql jdbc resultsetmetadata. :
string query = "select * vendors"; preparedstatement pstmt = con.preparestatement(query); resultsetmetadata meta = pstmt.getmetadata(); system.out.println(meta);
but doesn't work insert/update
statement.
does have solution that?
i tried various other solutions without success.
thanks
you can column name of table using resultssetmetadata this,
resultsetmetadata rsmd=res.getmetadata(); int columncount=rsmd.getcolumncount(); (int = 1; i<= columncount; i++) { columnheading=columnheading+"\t"+rsmd.getcolumnname(i); system.out.println(columnheading);
Comments
Post a Comment