File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 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: 4658
    
    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