public void executeSQLScript(File file) throws IOException, SQLException
	{
		if (file == null)
			throw new NullPointerException("sql file not given");
		Logger.debug("executing " + file.getAbsolutePath());
		if (!file.canRead() || !file.exists())
			throw new IOException("SQL file does not exist or is not readable");
		

		Connection conn   = null;
		DBSystem session  = null;
    FileReader reader = null;
    
		try
    {
      
		  session = control.startDatabase(config);
			conn    = session.getConnection(username,password);
      reader  = new FileReader(file);

			Logger.info("executing sql commands from " + file.getAbsolutePath());
      ScriptExecutor.execute(reader,conn);
		}
		finally {
      try
      {
        if (reader != null)
          reader.close();
      }
      catch (Exception e3)
      {
        Logger.error("error while closing file " + file.getAbsolutePath(),e3);
      }
      try
      {
        if (conn != null)
          conn.close();
      }
      catch (Exception e3)
      {
        Logger.error("error while closing connection",e3);
      }
      try
      {
        if (session != null)
          session.close();
      }
      catch (Exception e4)
      {
        Logger.error("error while closing session",e4);
      }
		}
		
	}