This week's book giveaway is in the Reactive Progamming forum. We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line! See this thread for details.
I am trying to create multiple tables from a single textfile called "tables.sql". The tables are marked with a "+" and "|" sign as a delimeter after each
line. In a part of the code I replace the delimeters with the replace method in the String class with some empty space, "" and the "+" sign with a
new line character.
My tables are very basic for this post but longer in real world, they look similar to this in the text file "tables.sql".
Here is my java code for processing the file with the example tables but it doesn't work. I get the error message "You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'CREATE TABLE example2_tbl"
Why is this not working? I don't understand why jdbc can't create multiple tables in one query from a text file and what is needed for it to do so.
I think i must be missing something really obvious here. Any hint or enlightment in this matter is very much appreciated.
Thanks a lot in advance!