Subject | Re: [Firebird-Java] Blob and update pb |
---|---|
Author | Gbouille |
Post date | 2002-12-20T20:34:23Z |
Hello.
First of all, thank you. Then I apologize.
The problem is not in the method I used. But in the fact that I user a pool
of connections. And this connections are not autocommit....
So, as a conclusion, your method works fine (I tried it before I understand)
my method work fine, and I'm a idiot.
""William L. Thomson Jr."" <support@...> a �crit dans le
message news:<1040347384.3298.8.camel@...-studios.com>...
GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321
(prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagn�.
R�glement : http://www.ifrance.com/_reloc/sign.sms
First of all, thank you. Then I apologize.
The problem is not in the method I used. But in the fact that I user a pool
of connections. And this connections are not autocommit....
So, as a conclusion, your method works fine (I tried it before I understand)
my method work fine, and I'm a idiot.
""William L. Thomson Jr."" <support@...> a �crit dans le
message news:<1040347384.3298.8.camel@...-studios.com>...
> Hello,_____________________________________________________________________
> Here is how I insert a blob
>
> byte[] picture = // here I read the picture from a file, etc.
>
> String sq = "INSERT INTO PICTURES (PICTURE) VALUES (?);";
> PreparedStatement ps = c.prepareStatement(sq);
> ps.setBytes(1,picture);
> boolean result = ps.execute();
> ps.close();
>
> That works for me. You can use as many ? as you want, just reference
> them in order
>
> So you could have
>
> String sq = "INSERT INTO PICTURES (PICTURE1,PICTURE2) VALUES (?,?);";
> PreparedStatement ps = c.prepareStatement(sq);
> ps.setBytes(1,picture1);
> ps.setBytes(2,picture2);
> boolean result = ps.execute();
> ps.close();
>
> For updates
>
> String sq = "UPDATE GALLERY_PICTURES SET PICTURE=?";
> PreparedStatement ps = c.prepareStatement(sq);
> ps.setBytes(1,picture);
> boolean b = ps.execute();
> ps.close();
>
> In short byte[] work great for me. I really have not tried any other
> form. This works for both binary and text data.
>
> --
> Sincerely,
> William L. Thomson Jr.
> Support Group
> Obsidian-Studios Inc.
> 439 Amber Way
> Petaluma, Ca. 94952
> Phone 707.766.9509
> Fax 707.766.8989
> http://www.obsidian-studios.com
>
>
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> Get 128 Bit SSL Encryption!
> http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/saFolB/TM
> ---------------------------------------------------------------------~->
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321
(prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagn�.
R�glement : http://www.ifrance.com/_reloc/sign.sms