I think that adding a schema name element as described below would be a
great idea. At the present moment, I am hacking
JDBCStartCommand.tableExists:
DatabaseMetaData dmd = con.getMetaData();
rs = dmd.getTables(con.getCatalog(), dmd.getUserName(),
tableName, null);
But I might point out that for us, this is just for the practical
convenience of sharing a single Oracle instance amongst half a dozen
developers. I suspect that it's not very portable across dbms's.
Adding an optional <schema> element to jbosscmp-jdbc.xml would certainly
resolve my problem in a platform independent way.
BTW. I don't think that using:
<TABLE>myschema.mytable</TABLE>
will work in the current implementation anyway, because the table name
is also used for generating the pk constraint name. The above will yield
something like "pk_myschema.mytable", which probably won't work.
On Tuesday, April 16, 2002, at 02:32 AM, Dain Sundstrom wrote:
> Yes, it is the same work if you are going to specify both. The real
> benefit comes from being able to specify <schema-name> in the defaults
> section.
>
> -dain
>
> Ignacio Coloma wrote:
>
>> I don't see how that is different than using MYSPACE.MYTABLE. Same
>> amount of code for the user, but you would have to support Yet Another
>> Feature. IMHO it's the same to write:
>> <SCHEMA>myschema</SCHEMA>
>> <TABLE>mytable</TABLE>
>> than
>> <TABLE>myschema.mytable</TABLE>
>> Do other environments support this? This should be a common problem. As
>> far as I remember Delphi left you alone on this one.
>> On Mon, 2002-04-15 at 15:56, Dain Sundstrom wrote:
>>> This looks like a hack to me. Should we consider adding a
>>> schema-name element to the table configuration? By this I mean that
>>> where ever we have table-name in the jbosscmp-jdbc.xml file we can
>>> have an optional schema-name element. Also in the getTables call in
>>> we would pass the schema name as the second argument.
>>>
>>> Does this make since?
>>>
>>> Does anyone else have an opinion on this?
>>>
>>> -dain
>>>
>>> [EMAIL PROTECTED] wrote:
>>>
>>>
>>>> Maybe you could take only the last period delimited token (meaning in
>>>>
>>>> MYSCHEMA.MYTABLE use MYTABLE) as the tablename when you must be using
>>>>
>>>> only a table name, not a qualified tablename. I would expect that
>>>>
>>>> most RDBMS products, open or closed source, use this convention
>>>> of "."
>>>>
>>>> delimiting tokens in table and column names.
>>>>
>>>> Cheers
>>>>
>>>>
>>>>
>>>>> From: Dain Sundstrom <[EMAIL PROTECTED]>
>>>>> Date: 2002/04/15 Mon AM 10:40:32 EDT
>>>>> To: [EMAIL PROTECTED]
>>>>> Subject: Re: [JBoss-dev] Problem in JDBCStartCommand.java
>>>>>
>>>>> JL@esial wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I am using JBoss 3.0.0beta2(200204150942) on Win2k SP2.
>>>>>> The function tableExists in this class makes the following jdbc
>>>>>> call:
>>>>>> rs = dmd.getTables(con.getCatalog(), null, tableName, null);
>>>>>>
>>>>>> I am using DB2 as dbms, and this piece of code will not work if
>>>>>> tableName contains a prefix.
>>>>>>
>>>>> Why would it have a prefix?
>>>>>
>>>>>
>>>>>
>>>>>> Indeed, I have to configure my
>>>>>> jbosscmp-jdbc.xml ejb/table mappings like that:
>>>>>> <table-name>MYSCHEMA.MYTABLE</table-name> to get the SQL
>>>>>> statements work properly with DB2. But then the
>>>>>> tableExists method will always return false since it takes
>>>>>> MYSCHEMA.MYTABLE as tableName.
>>>>>>
>>>>>>
>>>>> JBossCMP tries it's best to autogenerate tables, but it can not
>>>>> solve all problems. I shoot for 80%. If you need an exact
>>>>> mapping, you will have to create the tables by hand (you should
>>>>> also do this before sending the application to production).
>>>>>
>>>>> If you have a *SIMPLE* solution that works on all of the major
>>>>> commercial and all opensource DBs, then I am open to the
>>>>> suggestion/ patch.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Is there an easy way to set a tablename prefix or even a schema
>>>>>>
>>>>>> name in jbosscmp-jdbc.xml ? Right now, I think I will have to
>>>>>> patch my own code, but I believe many people out there using
>>>>>> DB2 or Oracle might encounter the same problem.
>>>>>>
>>>>>>
>>>>> I don't think others have this problem, as you are the first to
>>>>> report it as a problem.
>>>>>
>>>>> -dain
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Jboss-development mailing list
>>>>> [EMAIL PROTECTED]
>>>>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> _______________________________________________
>>> Jboss-development mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>>
>>>
>>>
>
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development