org.d2rq.db
Class SQLScriptLoader

java.lang.Object
  extended by org.d2rq.db.SQLScriptLoader

public class SQLScriptLoader
extends Object

Reads SQL statements from a file or other source. Statements must end with semicolon and must end at the end of a line. Lines starting with -- are considered comments and are ignored.


Constructor Summary
SQLScriptLoader(Reader in, Connection conn)
           
 
Method Summary
 void execute()
           
static void loadFile(File file, Connection conn)
          Loads a SQL script from a file and executes it.
static void loadURI(URI url, Connection conn)
          Loads a SQL script from a URL and executes it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLScriptLoader

public SQLScriptLoader(Reader in,
                       Connection conn)
Method Detail

loadFile

public static void loadFile(File file,
                            Connection conn)
                     throws FileNotFoundException,
                            SQLException
Loads a SQL script from a file and executes it.

Throws:
FileNotFoundException
SQLException

loadURI

public static void loadURI(URI url,
                           Connection conn)
                    throws IOException,
                           SQLException
Loads a SQL script from a URL and executes it.

Throws:
IOException
SQLException

execute

public void execute()
             throws SQLException
Throws:
SQLException