🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.database
Article #218

Re: QueryDataSet: How to do "trial" query and accept or decline

#218
From: John T. Dow
Date: Wed, 19 Jul 2006 15:11
54 lines
2517 bytes
Thanks for the suggestion, which I tried. Unfortunately it's not working. 

Before changing the query string, I did this:

    HashMap saveqds = new HashMap();
    saveqds.put("SAVE", actualqds);

When wanting to revert to the original, I did this:

    actualqds = (QueryDataSet) saveqds.get("SAVE");

Having done this, the query string has not reverted and the row count 
remains 0.

John




"Mehmet F. Erten" <mehmet_erten@mblsoft.com> wrote in
news:44be3b53$1@newsgroups.borland.com: 

> Hi,
> Try this.
> 
> hasmap or treemap myMap
> myMap.put("OLD", currentQueryDataSet)
> currentQueryDataSet = new QueryDataSet(with the new Query String).
> If you don't like it. (if getRowCouunts == 0)
> currentQueryDataSet = (QueryDataSet) myMap.get("OLD");
> 
> "John T. Dow" <jo
> hn@johntdow.com> wrote in message 
> news:Xns98053677CC68Cjohnjohntdowcom@207.105.83.66...
>> Is it possible to change a querydataset's query string and execute
>> the query, and then revert to the original query string with the
>> original rows and cursor position without having to reexecute with
>> the original query string?
>>
>> I have an application where the user can easily create new queries on
>> the fly. As I have developed it so far, if the user tries a new
>> query, he loses
>> the old. I would like to be able to revert to the old query, for
>> example if
>> the new query fails to find any rows.
>>
>> Is it possible to do something clever like saving the original
>> QueryProvider? Can you clone the entire qds, change the query string
>> etc, and then if you like the outcome substitute the new qds for the
>> old? 
>>
>> John 
> 
> 
Technical Details
Message-ID: <Xns980571EA9B000johnjohntdowcom@207.105.83.66>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.germany.com!newsfeed.utanet.at!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail
References: <Xns98053677CC68Cjohnjohntdowcom@207.105.83.66> <44be3b53$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,3b0213ebece65c18
X-Google-Attributes: gid1073da,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.jbuilder.database
Subject: Re: QueryDataSet: How to do "trial" query and accept or decline
From: "John T. Dow" <john@johntdow.com>
References: <Xns98053677CC68Cjohnjohntdowcom@207.105.83.66> <44be3b53$1@newsgroups.borland.com>
Message-ID: <Xns980571EA9B000johnjohntdowcom@207.105.83.66>
User-Agent: Xnews/5.04.25
NNTP-Posting-Host: 151.201.53.226
Date: 19 Jul 2006 08:11:53 -0700
X-Trace: newsgroups.borland.com 1153321913 151.201.53.226 (19 Jul 2006 08:11:53 -0700)
Lines: 55
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.germany.com!newsfeed.utanet.at!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail