-
1. Re: Table name case in CMP sql statements
oytan022 May 7, 2002 12:11 AM (in response to cwbrandon)Can u test ur sql query on ur db window not from the bean? If so, u should match the case.
-
2. Re: Table name case in CMP sql statements
cwbrandon May 7, 2002 12:19 AM (in response to cwbrandon)Well yes I can perform the query fine if I change the lowercase "persons" to "Persons" in SQL Server's Query Analyzer. The thing is the container generates the SQL with the table names in all lower case...I don't have control over the generated SQL statements since I'm using CMP.
-
3. Re: Table name case in CMP sql statements
dsundstrom May 13, 2002 6:13 PM (in response to cwbrandon)You will have to set create-table and remove-table to false, but you didn't want these on anyway. It should work then as sql is case insensitive.
-
4. Re: Table name case in CMP sql statements
cwbrandon May 13, 2002 8:57 PM (in response to cwbrandon)Actually with SQL Server you can setup the database as case sensitive, so all SQL executed within it is case sensitive (I didn't previously know any database supported this), so that's my problem. The tables are already there (the database is set to case-sensitive) and I'm writing CMP EJBs for them. I'm not actually generating the tables from the container. (I have both create-table and remove-table set to false). So when the CMP statements are generated, and the table name is lowercase I get an error telling me the table can not be found. For example, one of the table names is Persons and the generated SQL statement foun in the log file uses "persons" instead of Persons. Joss3.0.0alpha used the exact names of the tables found in the jbosscmp-jdbc.xml file so I had no similar problems before.
Thanks,
Chad -
5. Re: Table name case in CMP sql statements
dsundstrom May 14, 2002 1:24 AM (in response to cwbrandon)Oh. I can see how that happens. The metadata in JDBC driver you are using lies. I check the metadata on startup and convert the table name as required. This allows the same config to be used on several databases, but it relies on the metadata being accurate.
In the future I would like to be able to override the metadata mapping in the JCA wrapper, so you could fix bad drivers.
I don't know what you can do in the mean time. I'll think about it. -
6. Re: Table name case in CMP sql statements
cwbrandon May 14, 2002 10:25 AM (in response to cwbrandon)Ok, thanks Dain.
-
7. Re: Table name case in CMP sql statements
cwbrandon May 14, 2002 10:28 AM (in response to cwbrandon)I am actually using a different driver than I was with JBoss3.0.0alpha so, so yeah that is probably where the issue is. We haven't purchased a driver yet and have just been using trial or development versions. I'll try switching to a different driver and see if that takes care of the problem. Thanks again.
Chad -
8. Re: Table name case in CMP sql statements
cwbrandon May 14, 2002 11:32 AM (in response to cwbrandon)Swithchin to a different driver fixed the problem...thanks!
-
9. Re: Table name case in CMP sql statements
dsundstrom May 14, 2002 11:35 AM (in response to cwbrandon)Cool, what driver? Someone else is going to run into this problem.
-
10. Re: Table name case in CMP sql statements
cwbrandon May 14, 2002 11:42 AM (in response to cwbrandon)Well the driver that was giving me problems (lower case table names) was TaveConn25M Type 4 Driver for MS SQL Server from Atinav. I switched to the i-net MERLIA 2000 Version 1.01 for MS SQL Server, and it seems to be generating the correct case for the table names.