Hi !!!
Thanks for your reply, this solution is simple, easy to understand and
is not hard to code at all. My only objection would be the MyBean class, if
I understood it right, the DataProvider is tied to the bean in a way that
makes it not reusable:
String query = "SELECT name, age FROM mybean LIMIT " + start + "," +
count;
----
bean.setName(set.getString("name"));
bean.setAge(set.getInt("age"));
What I mean is, what happens if I want to query another table, do I have
to change the ResultSetDataProvider implementation, or provide another
implementation for each table ??
I'm not sure if is it even possible to do what I want, surely it would
be more complex and hard to do, but if it saves from creating custom code
for each query, I guess it would justify the extra work.
In most web usages, this implementation is ok because you don't have
that much database queries, but at my work we have been asked to port a
desktop application to a web implementation, and it uses lots of queries
with flexible filtering criteria, for example (Visual Basic pseudocode):
recordset1 = ExecuteQuery("SELECT a, b, c FROM table1");
datagrid1.setColumns("a", "b", "c");
datagrid1.setRecordSet(recordset1);
datagrid1.refresh();
Perhaps this simplified Visual Basic example shows what I'm trying to
do, as you can see, I don't have to cast the recordset to any specific bean
type, it's just a bunch of cells. That's why I'm looking for that kind of
more abstract approach.
Thanks for your help !!!
Daniel
Ayodeji Aladejebi wrote:
>
> create table mybean (id int primary key, name varchar, age int) bla bla
> bla....
>
> //make a model
> class MyBean implements Serializable {
> private String name;
> private int age;
> }
>
> //create your idataprovider
>
> ---------
>
> //i would not know if there is some other more efficient manner but this
> is
> as simple enough
> // and it works with DataView, Paging, DataTable
>
> this should not be too hard, is it? or you need something else
>
> On 8/23/07, dtoffe <[EMAIL PROTECTED]> wrote:
>>
>>
>> Uhh, well... yes, you are right.....
>>
>> Excuse me but I fail to see how that could help to solve the problem
>> I
>> presented, please keep in mind that I'm not native english speaker and
>> perhaps I'm not using the proper words, I'll try to explain that more
>> precisely.
>> ---------
>
--
View this message in context:
http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12295661
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]