Rowset column name problem

All,

I am a new user of JSC and am hopefully running into a simple issue. I've searched the forums here but so far have not found any postings regarding my problem. Apologies if this has been asked and answered before.

I am building a webapp to display data from a MySQL database. There are several places in the schema where I need to join to the same table multiple times. I have setup the joins in the query builder and also setup a view in the database directly that does the joins. Either way, the query works fine and returns the expected data. The trouble is that the rowset underlying the dataprovider is not returning the metadata using either the table&column aliases from the query builder or the column names from the view, but rather in all cases returning the underlying table and column names. In my table component I am trying to display the data from each table.column alias distinctly but because the metadata visible to the dataprovider is the same (ie table.column), I end up with both table columns showing the same data. I've tried to track down the implementation of the metadata getter method but it is apparently in source that is not provided.

In case it matters, I'm using mysql-connector-java-5.0.3-bin.jar as the driver.

Is there something I'm missing or is there a workaround for this?

Thanks in advance,

Scott

[1391 byte] By [ScottElvingtona] at [2007-11-26 13:56:42]
# 1

You can try column aliases thus:

Select a.a AS col1 a.b AS col2 b.a AS col3 b.b AS col4 from a,b

I's also expect that simply refering to the columns as table.column would work.

I'm not sure if anyone has sucessfully used the MySql 5.0.x Driver with Creator. Most people seem to be using the 3.1.1x Driver.

yossariana at 2007-7-8 1:36:21 > top of Java-index,Development Tools,Java Tools...
# 2

Thanks,

I should have been more explicit in my description of the problem.

Example of what I have is as follows:

select table1.columnA, table2.columnA as columnX,....

from table_name as table1 join table_name as table2....

where there are other tables and columns in the select clause as well as the join conditions but where the base table and column (in the above table_name.columnA) are used twice with two different aliases. I have done this join directly in the query builder and also created a view, hiding the actual names of the columns. I can execute either query in the query builder and the columns in the result set "spreadsheet" are labeled with the base table column names, not the aliased names or the view's column names. This is causing a problem because the same thing happens when I try to bind the ui:table columns to the dataprovider. It uses the base tables' column names and I have no way to distinguish between the different aliases. If I try to manually change the jsp to refer to the aliased name or the view column name, I get an exception that the aliased tablename and or column is an invalid parameter.

Sorry if that was not clear in my original post.

ScottElvingtona at 2007-7-8 1:36:21 > top of Java-index,Development Tools,Java Tools...
# 3
I'm using aliases and calculated columns etc -- no problems. Don't have any of the same names though (maybe I do?) VWP & Creator. Driver v3.1.12. I'd give that a try if I were you.
yossariana at 2007-7-8 1:36:21 > top of Java-index,Development Tools,Java Tools...
# 4
Thanks again.I replaced the 5.0.3 driver with the 3.1.14 driver and that solved my issue. I'm not sure why the different drivers would be pulling back different metadata but for now I'll stick with the 3.1.14 driver.Thanks again,Scott
ScottElvingtona at 2007-7-8 1:36:21 > top of Java-index,Development Tools,Java Tools...