Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use octetsAsBytes behaviour by default [JDBC205] #254

Closed
firebird-automations opened this issue Dec 8, 2011 · 6 comments
Closed

Use octetsAsBytes behaviour by default [JDBC205] #254

firebird-automations opened this issue Dec 8, 2011 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

Assigned to: Roman Rokytskyy (rrokytskyy)

Duplicates JDBC240

Reported by mail by Fabiano Bonin:
My databases have some columns declared as "char(16) character set octets", which i use to store UUIDs.
Jaybird treats these columns as type STRING, except in case the parameter octetsAsBytes is passed to the connection, then it treats
these columns as type BYTES.

When they are treated as STRINGs, when the CRS is loaded from a ResultSet, it usually truncates the field, as i suppose it calls getString() to load the column value, and Java tries to interpred these bytes following some charset and encoding, thus truncating or getting an enexpected behavior depending on the bytes it finds.

Don´t you think it would be better to treat these columns as BYTES as the standard behavior? I think everyone using character set octets uses it to store binary data, or do you see another use for it? Even if eventually an octecs field can store a encoded string, if Jaybird stores its value as BYTES, when the developer calls getString(), it would then convert the bytes to String, and it wouldn´t change the actual behavior, would it?

What do you think about this?

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

It might be that some part of the octetsAsBytes behavior is also missing from ResultSetMetaData.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue duplicates JDBC240 [ JDBC240 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Duplicate of JDBC240, closing this one as JDBC240 is broader than just defaulting to octetsAsBytes

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment