/*
 * Created on 02-nov-2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.postgresql.coreDriver;

import java.sql.SQLException;

/**
 * @author jsalas
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class MyTest {

	public void Execute(ContextTask ctxt) throws Exception{		
		StringBuffer errormsg = ctxt.getErrorMessage();
		errormsg.append("Adios");
		if (ctxt.getStep() == 7){
			throw new SQLException("Fallo");
		}
		ctxt.setStep(14);
	}
	
	public static void main(String[] args) {
		ContextTask ctxt = new ContextTask();
		ctxt.setErrorMessage(new StringBuffer());
		StringBuffer errormsg = ctxt.getErrorMessage();		
		errormsg.append("Hola");
		ctxt.setStep(7);
		MyTest my = new MyTest();
		try {
			my.Execute(ctxt);
		} catch (Exception e){
			//System.out.println("Exception: " + e.toString());
		}
		System.out.println("ErrorMsg: " + ctxt.getErrorMessage().toString() + " Step: " + ctxt.getStep());
	}
}
