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

Jaybird failed to map a java Character to a char database type: TypeConvertionException: Error converting to object. [JDBC227] #276

Closed
firebird-automations opened this issue Jan 13, 2012 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: James Calfee (james_jcalfee.info)

Assigned to: Roman Rokytskyy (rrokytskyy)

Is related to JDBC222

I attempted to pass a java Character to set Object as follows:

preparedStatement.setObject(n, javaCharacter)

The column type was CHAR(1) .. This caused an immediate TypeConvertionException. Please support any reasonable Java to database type mappings. As a work-around I had to convert my Character object to a String object.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

security: Developers [ 10012 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is related to JDBC222 [ JDBC222 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

The conversion of java.lang.Character to an SQL type is not specified by the JDBC specification (see Appendix B of the JDBC 4.1 specification). Therefor this is not a bug. There is only one mention of java.lang.Character in the whole JDBC spec and that is only as a reference for the javadoc on how Java treats unicode.

When I have time I will see how other drivers handle this case and make a decision to reject or treat this as an improvement based on that.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

priority: Major [ 3 ] => Trivial [ 5 ]

issuetype: Bug [ 1 ] => Improvement [ 4 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

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

No branches or pull requests

1 participant