Re: Why is bool == java.sql.Types.BIT ??
От | Oliver Jowett |
---|---|
Тема | Re: Why is bool == java.sql.Types.BIT ?? |
Дата | |
Msg-id | BANLkTimmHNbkb+LyJfGtEuhhSuO6TFH6Yg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Why is bool == java.sql.Types.BIT ?? (aditsu <aditsu@yahoo.com>) |
Ответы |
Re: Why is bool == java.sql.Types.BIT ??
|
Список | pgsql-jdbc |
On 24 May 2011 23:05, aditsu <aditsu@yahoo.com> wrote: > > Oliver Jowett wrote: >> >> Can you explain what (in your application) you would do differently >> for a column that returned Types.BOOLEAN versus a column that returned >> Types.BIT? >> > > It has to do with analyzing/comparing table structures, copying tables on > another server (especially when it uses a different DBMS), and generally > handling column types automatically in various situations. > If it returns BIT for a boolean column, then I have to add some special > handling when using postgres to check for the type name and adjust > accordingly. > In the particular application where I found the problem, I was doing a > "diff" between 2 table structures, and it was generating something like > "ALTER TABLE request ADD COLUMN active bit" where "active" was supposed to > be boolean. While both types seem to use Boolean on the java side, they are > not compatible in postgres. Don't you have a general problem here that the JDBC metadata cannot fully represent many database-specific types? (For example, how would you distinguish BIT from BIT(n) from BIT VARYING(n)?) Oliver
В списке pgsql-jdbc по дате отправления: