my dog learned polymorphism*
The moose likes JDBC and the fly likes parse a multi-line SQL programs to get the single-line SQL statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "parse a multi-line SQL programs to get the single-line SQL statements" Watch "parse a multi-line SQL programs to get the single-line SQL statements" New topic
Author

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

albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
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

Joined: May 03, 2008
Posts: 4531
    
    5

Let's see what you've tried first, preferably in the form of an SSCCE
http://mindprod.com/jgloss/sscce.html


luck, db
There are no new questions, but there may be new answers.
albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
This is my first attempt.
Feel free to suggest improvement.


Output is
jdbcTemplate.update("DROP TABLE assets");
DROP TABLE assets");
DROP TABLE assets
 
 
subject: parse a multi-line SQL programs to get the single-line SQL statements