public static void checkAndCreateSchema(Connection conn,PrintWriter pw) {
		Statement stmt = null;
		ResultSet rs = null;

		try	{
			conn.setAutoCommit(true);
		} catch (SQLException  se) {
			pw.println("[NsSampleWork] Error when setting autocommit on connection; exception thrown: ");
			se.printStackTrace();
		  }

		// Check for existence of schema by quering the catalog systables
		try {
			stmt = conn.createStatement();
			rs = stmt.executeQuery("select tablename from sys.systables " +
								" where tablename = 'SAMPLETBL'");
			if (rs.next()) {
				pw.println("[NsSampleWork] Table 'SAMPLETBL' already exists; no need to create schema again.");
				return;
			}
		} catch (SQLException  se) {
			pw.println("[NsSampleWork] Unable to query the metadata for existence of table SAMPLETBL; exception is "+se);
			pw.println("[NsSampleWork] Exiting the application.");
			se.printStackTrace();
			System.exit(1);
		  }

		// Create the necessary table and indexes
		try {
			pw.println("[NsSampleWork] Begin creating table - SAMPLETBL and necessary indexes. ");
			stmt.execute("create table SAMPLETBL (" +
						  "t_int int," +
						  "t_char char(15),"+
						  "t_float float," +
						  "t_key bigint )");
			stmt.execute("create index t_char_idx on SAMPLETBL ( t_char)");
			stmt.execute("create index t_float_idx on SAMPLETBL ( t_float)");
			stmt.execute("create index t_key_idx on SAMPLETBL ( t_key )" );
		} catch (Exception  e) {
			pw.println("[NsSampleWork] Error when creating schema; exception is " + e.toString());
			pw.println("[NsSampleWork] Exiting the application.");
			e.printStackTrace();
			System.exit(1);
		  } finally {
			  try {
			  	if(rs != null)
				  rs.close();
			  	if(stmt != null)
				  stmt.close();
			  } catch (Exception e) {
				  e.printStackTrace();
			    }
			}
	 }//end of method checkAndCreateSchema()