boolean savetodatabase(String columns[], String items[])
	{
		boolean errorfound = false;
		String builtstatement;
		Statement stmt = null;
		java.sql.Connection conn = null;
		java.sql.ResultSet rs = null;
		try
		{
			//get a connection
			Connection.initialize_Connection_SQL();
			conn = Connection.getSQLConn();
			
			//check to see if a line already exists with the primary key
			builtstatement = "select * from Product where " + columns[0]
					  + " = " + items[0] + ";";
			
			stmt = conn.createStatement();
			rs = stmt.executeQuery(builtstatement);
			
			//check to see if the resultset has data - while loop and boolean check
			//from Adam Hardy at http://www.coderanch.com/t/296373/JDBC/databases/check-Result-set-null
			boolean rshasdata = false;
			while (rs.next())
			{
				rshasdata = true;
			}
			
			if (rshasdata)
			{
				//build an update statement to overwrite database data with backup file data
				builtstatement = "update " + Connection.PRODUCT_TABLE_NAME + " set " + columns[1] + " = '" + items[1]
						  + "', " + columns[2] + " = '" + items[2] + "', " + columns[3] + " = '" + items[3]
						  + "', " + columns[4] + " = '" + items[4] + "', " + columns[5] + " = '" + items[5]
						  + "', " + columns[6] + " = '" + items[6] + "', " + columns[7] + " = '" + items[7]
						  + "' where " + columns[0] + " = " + items[0];
			}
			else
			{
				//insert a new product row
				builtstatement = "insert into " + Connection.PRODUCT_TABLE_NAME + " (" + columns[0] + ", " + columns[1]
						  + ", " + columns[2] + ", " + columns[3] + ", " + columns[4]
						  + ", " + columns[5] + ", " + columns[6] + ", " + columns[7]
						  + ") values('" + items[0] + "', '" + items[1] + "', '" + items[2]
						  + "', '" + items[3] + "', '" + items[4] + "', '" + items[5] + "', '"
						  + items[6] + "', '" + items[7] + "');";
			}		
						
			//send the SQL statement to SQL
			stmt.executeUpdate(builtstatement);
		} //end try
		catch (Exception e)
		{
			System.err.println(e);
			errorfound = true;
		} //end catch
		//close connections and statement
		Connection.closeSQLConn();
		try
		{
			if(stmt != null)
			{
				stmt.close();
			}
		} //end try
		catch (Exception e)
		{
			System.err.println(e);
		} //end catch
		return errorfound;
	} //end savetodatabase method