• Post Reply Bookmark Topic Watch Topic
  • New Topic

parse a multi-line SQL programs to get the single-line SQL statements  RSS feed

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help to write a program to parse a multi-line SQL programs to get the single-line SQL statements enclosed inside "jdbcTemplate.update".
Input is:


Output is:
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's see what you've tried first, preferably in the form of an SSCCE
http://mindprod.com/jgloss/sscce.html
 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my first attempt.
Feel free to suggest improvement.


Output is
jdbcTemplate.update("DROP TABLE assets");
DROP TABLE assets");
DROP TABLE assets
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!