Subject Re: [Firebird-Java] Firebird table field problem
Author Helen Borrie
PLEASE DO NOT DO ALL THIS REQUOTING. It is a capital offence in lists and

At 06:38 PM 16-04-02 -0700, you wrote:
>I have a field name 'password' in a table X. During conversion from Access
>the field name was automatically converted to 'passwordcol'. Looks like
>doesn't allow 'password' as field name. I have an existing Java
>application with
>more than a thousand classes, with complex relationships, and database
>tables mapped
>as java objects. This makes it very difficult to change the field name in
>Java app
>itself. What could be the best solution in such a situation? Any thoughts?

You can use "password" as an identifier provided you (a) define it with
double-quoted delimiters and (2) always refer to it in SQL using the
d/quotes. Double-quoting identifiers also makes them case-sensitive.

To get into the position where your passwordcol column has the right
identifier for the app, do

alter table mytable alter passwordcol to "PASSWORD";
Provided the string you change it to has the same case as the references in
your java classes, you won't need to add the quotes to the occurrences in
the classes. If you have been in the habit of not using one case or the
other, then you'll have some grepping to do.

This won't help if your database is Dialect 1 though - quoted identifiers
aren't supported there. You'll have to stick with passwordcol and change
your classes.


All for Open and Open for All
Firebird Open SQL Database · ·