Re: BUG #8389: JDBC Driver assumes first column to be an integer

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "ivan(dot)pli(at)solidit(dot)cl" <ivan(dot)pli(at)solidit(dot)cl>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #8389: JDBC Driver assumes first column to be an integer
Date: 2013-08-20 19:02:23
Message-ID: 1377025343.62060.YahooMailNeo@web162901.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"ivan(dot)pli(at)solidit(dot)cl" <ivan(dot)pli(at)solidit(dot)cl> wrote:

> When having a table with the next columns:
> content varchar(10)
> idcontent int primary key

> Persisting a row using the JDBC driver (I used JBoss and
> hibernate to persist a bean)

> The JDBC driver throws an exception while trying to parse the
> first column content (a string) as an integer.

I think the behavior you are seeing is due to JBoss or Hibernate.
I've used many tables with no integer columns through PostgreSQL
JDBC.  Hibernate, by default, seems to want every table to have a
primary key of a single integer column, it but can be coerced to
work with a properly normalized relational database with a little
effort.  In my experience it's worth the effort.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira 2013-08-20 23:01:04 Re: Dúvida
Previous Message Fernando Ewald 2013-08-20 19:01:06 Dúvida