This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 249
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: 4664
    
    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: 249
This is my first attempt.
Feel free to suggest improvement.


Output is
jdbcTemplate.update("DROP TABLE assets");
DROP TABLE assets");
DROP TABLE assets
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parse a multi-line SQL programs to get the single-line SQL statements