After you read all text from file, you split all sql statements by semicolon. Then you can execute every sql statement one by one.