You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Thomas Manson <de...@gmail.com> on 2005/11/02 01:47:35 UTC
[DBUTILS] integer type not retrieve from the database
Hi,
I'm trying to use DBUtils (with DBCP) with Java 1.5 and MySQL5.
I make this query
query = "SELECT idDelegation, nom, departement, testint from
delegation order by departement asc";
on this table :
CREATE TABLE `delegation` (
`id_delegation` int(10) unsigned NOT NULL auto_increment,
`nom` varchar(45) NOT NULL,
`departement` varchar(8) NOT NULL,
PRIMARY KEY (`id_delegation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
to be mapped with this object :
public class DelegationDto
{
private int idDelegation;
private String nom ;
private String departement ;
private int testint;
/*+Getter & Setter*/
}
(List)this.queryRunner.query(query, new BeanListHandler(DelegationDto.class));
The 2 String columns a retrieved, but not the integer one. I get 0 for
int and null for Integer type.
Does any one have an idea? Why should it work with string and not with
integer? Bug??
Thanks for help,
Manson Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [DBUTILS] integer type not retrieve from the database
Posted by Thomas Manson <de...@gmail.com>.
Well, i've already tried this : iddelegation, idDelegation. nothing will do.
Also, i've added a column that don't use the auto-increment feature
(juste to try) and it still doesn't work
Maybe integer in MySQL 5 metadata has changed?
On 11/2/05, Garth Patil <ga...@hotmail.com> wrote:
> try renaming the db field to idDelegation. i've never had success with
> underscores using dbutils.
> /garth
>
> >From: Thomas Manson <de...@gmail.com>
> >Reply-To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >To: commons-user@jakarta.apache.org
> >Subject: [DBUTILS] integer type not retrieve from the database
> >Date: Wed, 2 Nov 2005 01:47:35 +0100
> >
> >Hi,
> >
> >I'm trying to use DBUtils (with DBCP) with Java 1.5 and MySQL5.
> >
> >
> >I make this query
> >
> >query = "SELECT idDelegation, nom, departement, testint from
> >delegation order by departement asc";
> >
> >on this table :
> >
> >CREATE TABLE `delegation` (
> > `id_delegation` int(10) unsigned NOT NULL auto_increment,
> > `nom` varchar(45) NOT NULL,
> > `departement` varchar(8) NOT NULL,
> > PRIMARY KEY (`id_delegation`)
> >) ENGINE=InnoDB DEFAULT CHARSET=latin1;
> >
> >to be mapped with this object :
> >
> >public class DelegationDto
> >{
> > private int idDelegation;
> > private String nom ;
> > private String departement ;
> > private int testint;
> >/*+Getter & Setter*/
> >}
> >
> >
> >(List)this.queryRunner.query(query, new
> >BeanListHandler(DelegationDto.class));
> >
> >The 2 String columns a retrieved, but not the integer one. I get 0 for
> >int and null for Integer type.
> >
> >Does any one have an idea? Why should it work with string and not with
> >integer? Bug??
> >
> >Thanks for help,
> >
> >Manson Thomas.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
RE: [DBUTILS] integer type not retrieve from the database
Posted by Garth Patil <ga...@hotmail.com>.
try renaming the db field to idDelegation. i've never had success with
underscores using dbutils.
/garth
>From: Thomas Manson <de...@gmail.com>
>Reply-To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>To: commons-user@jakarta.apache.org
>Subject: [DBUTILS] integer type not retrieve from the database
>Date: Wed, 2 Nov 2005 01:47:35 +0100
>
>Hi,
>
>I'm trying to use DBUtils (with DBCP) with Java 1.5 and MySQL5.
>
>
>I make this query
>
>query = "SELECT idDelegation, nom, departement, testint from
>delegation order by departement asc";
>
>on this table :
>
>CREATE TABLE `delegation` (
> `id_delegation` int(10) unsigned NOT NULL auto_increment,
> `nom` varchar(45) NOT NULL,
> `departement` varchar(8) NOT NULL,
> PRIMARY KEY (`id_delegation`)
>) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
>to be mapped with this object :
>
>public class DelegationDto
>{
> private int idDelegation;
> private String nom ;
> private String departement ;
> private int testint;
>/*+Getter & Setter*/
>}
>
>
>(List)this.queryRunner.query(query, new
>BeanListHandler(DelegationDto.class));
>
>The 2 String columns a retrieved, but not the integer one. I get 0 for
>int and null for Integer type.
>
>Does any one have an idea? Why should it work with string and not with
>integer? Bug??
>
>Thanks for help,
>
>Manson Thomas.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org