Board index » jbuilder » Can't refresh jdbTable

Can't refresh jdbTable


2005-02-01 06:30:49 PM
jbuilder8
Folks,
I created this tableDataSet that consists of some columns and add the tableDataSet to a jdbTable. Then I successfully add data to each row by:
tableDataSet1.insertRow(true);
for(int x=0; x<temp.length; x++){
tableDataSet1.setString(columnNames,value);
}
I wish to clear all the data and then reload the data - like a refresh. So when I:
tableDataSet1.deleteAllRows();
and reload the data the jdbTable remains blank. Is there a any hints to refresh a jdbTable or tableDataSet w/o having to restart it?
Thanks,
Richard
 
 

Re:Can't refresh jdbTable

Richard wrote:
Quote
I wish to clear all the data and then reload the data - like a
refresh. So when I:

tableDataSet1.deleteAllRows();

and reload the data the jdbTable remains blank. Is there a any hints
to refresh a jdbTable or tableDataSet w/o having to restart it?
deleteAllRows() does exactly what its name implies: it deletes all
rows. There's nothing to reload when you do that. empty() empties the
data set without actually deleting the data. However, the method you
really want is refresh(); that empties all rows and reloads from the
backing store.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:Can't refresh jdbTable

Kevin,
Thanks for the response. It seems I require a Provider in order to refresh. The examples of the Providers are not very helpful.
I think I may have to customize the Provider. I read acquire the data from a directory service and then place it in an ArrayList. I send the ArrayList, DataRow and TableDataSet to the Provider. I notice when I refresh the TableDataSet it does access the Provider but tells me that DataRows are not synch.
com.borland.dx.dataset.DataSetException: Attempt to use a DataRow with a DataSet that it is out of sync with.
Even if I instantiate only 1 DataRow and pass it to the provider it states that they are out of synch. I even tried instantiating another DataRow in the Provider to populate the TableDAtaSet there and it still states out of synch.
Any suggestions or good samples of Providers?
Thank you
Richard
"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
Richard wrote:

>I wish to clear all the data and then reload the data - like a
>refresh. So when I:
>
>tableDataSet1.deleteAllRows();
>
>and reload the data the jdbTable remains blank. Is there a any hints
>to refresh a jdbTable or tableDataSet w/o having to restart it?

deleteAllRows() does exactly what its name implies: it deletes all
rows. There's nothing to reload when you do that. empty() empties the
data set without actually deleting the data. However, the method you
really want is refresh(); that empties all rows and reloads from the
backing store.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

{smallsort}

Re:Can't refresh jdbTable

Richard wrote:
Quote
Thanks for the response. It seems I require a Provider in order to
refresh. The examples of the Providers are not very helpful.

Developing a Provider is a non-trivial exercise and should only be used
when the stock providers (QueryProvider, EJBProvider, etc.) don't suit
your needs.
Quote
I think I may have to customize the Provider. I read acquire the
data from a directory service and then place it in an ArrayList. I
send the ArrayList, DataRow and TableDataSet to the Provider. I
notice when I refresh the TableDataSet it does access the Provider
but tells me that DataRows are not synch.

I'm afraid I'm at a loss to understand exactly what it is you're trying
to do. If you're accessing a SQL-compliant database, the QueryDataSet
should do everything you need.
Quote
com.borland.dx.dataset.DataSetException: Attempt to use a DataRow
with a DataSet that it is out of sync with.

Even if I instantiate only 1 DataRow and pass it to the provider it
states that they are out of synch. I even tried instantiating
another DataRow in the Provider to populate the TableDAtaSet there
and it still states out of synch.

You don't pass anything to a Provider; it provides but does not consume
data.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html