db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: Problem with keyword as column name
Date Fri, 03 Oct 2003 08:20:32 GMT
hi oliver,

what would the correct sql look like using the escaped column name ?

jakob

Oliver Rutherfurd wrote:

>I'm having problems using OBJ (1.0rc3) to access a table in SQL Server which
>has a column named "Key".  I defined the field in my repository.xml file
>like so:
>
>    <field-descriptor column="Key"
>            jdbc-type="VARCHAR"
>            name="key"/>
>
>I get the following error:
>
>    java.sql.SQLException: [JCDEVDB]Incorrect syntax near the keyword 'Key'.
>
>I tried to escape the column name in the repository.xml file, like so:
>
>    <field-descriptor column="[Key]"
>            jdbc-type="VARCHAR"
>            name="key"/>
>
>I got the following error:
>
>    java.util.NoSuchElementException: Could not obtain next object: Error
>reading from result set: [TDS Driver]Column '[Key]' not found.
>
>Much as I'd like to change the column name, so this problem would just go
>away, it's not an option.  How can I get this to work?
>
>Thanks,
>-Ollie
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message