Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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: 239
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: 4523
    
    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: 239
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
 
Similar Threads
Restore problem
Using strings within strings to read vars?
Mapping same POJO to two tables in Hibernate XML mapping files
Three problems with mysql...
Hibernate is driving me crazy !