Re: Bit Varying Prepare Statement

Fred Toussi via Hsqldb-user <[email protected]> Fri, 20 Apr 2018 21:23:47 +0100
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <1524255827.240373.1345313432.64347A3A@webmail.messagingengine.com>
You can use seInt(), setString with "00001", or setBytes with a single byte array with version 2.4.0 and some earlier versions.

Perhaps you are inserting the bit map into the INTEGER  data_type_id column.

If you cannot fix it, please write a complete test case in Java and post it to the Help Forum.

Fred

On Fri, Apr 20, 2018, at 18:56, dmp wrote:
> Hello,
> 
> Given:
> 
> CREATE TABLE hsqltypes (
>     data_type_id IDENTITY PRIMARY KEY,
>     bit_type BIT DEFAULT NULL,
>     bitvarying_type BIT VARYING(5) DEFAULT NULL
> )
> 
> I'm able to use a Prepare Statement with BIT, but don't
> seem to be able to get BIT VARYING(x) to take.
> 
> SQLException value cannot be converted to target type.
> SQLState 22501 VendorError -3471
> 
> INSERT INTO "hsqltypes" ("data_type_id", "bit_type", "bitvarying_type")
> VALUES (?, ?, ?)
> 
> Tried, setObject(), setInt(), setString(), B'00001' All the same.
> 
> prepared_sqlStatement.setString(i++, "00001");
> 
> danap.
> 
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Hsqldb-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot