/**
 * 
 */
package testsuite.simple;

import testsuite.BaseTestCase;

/**
 * @author Tonci
 * SQLException for reading empty RS when reading INT column
 * SQLException for reading non existent column (with GetInt): Column XXX not found
 * java.lang.NullPointerException when reading non existent column with GetTimeStamp
 *
 */
public class TestBug33162 extends BaseTestCase {

	/**
	 * @param name
	 */
	public TestBug33162(String name) {
		super(name);
		// TODO Auto-generated constructor stub
	}
	public void testBug33162() throws Exception {
		System.out.println("java.vm.version         : " + System.getProperty("java.vm.version"));
		System.out.println("java.vm.vendor          : " + System.getProperty("java.vm.vendor"));
		System.out.println("java.runtime.version    : " + System.getProperty("java.runtime.version"));
		System.out.println("os.name                 : " + System.getProperty("os.name"));
		System.out.println("os.version              : " + System.getProperty("os.version "));
		System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler"));
		
	try {
		//convertToNull, exception	
		//jdbcCompliantTruncation
		createTable("bug33162", "(Id INTEGER NOT NULL PRIMARY KEY)");
		assertEquals(1, this.stmt.executeUpdate("INSERT INTO bug33162 (Id) values (1)"));
		this.rs = this.stmt.executeQuery("select * from bug33162 where Id='invalid'");
		this.rs.next();
		//this.rs.getInt("bug33162.Id");  // ok
		this.rs.getTimestamp("bug33162.Id");  // fails
		} finally {
			closeMemberJDBCResources();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		junit.textui.TestRunner.run(TestBug33162.class);
	}

}
