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

Can't set JSON fields via PreparedStatement #6382

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Can't set JSON fields via PreparedStatement #6382

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2017-07-30 23:48:37 +0200
From: Brian Ploetz <>
To: Martin van Dinther <<martin.van.dinther>>
Version: 11.27.1 (Jul2017)
CC: martin.van.dinther

Last updated: 2017-10-26 15:44:10 +0200

Comment 25527

Date: 2017-07-30 23:48:37 +0200
From: Brian Ploetz <>

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Build Identifier:

I have a JSON column in my table, and when trying to insert into that table using a PreparedStatement...

statement.setString(6, "{}");

...I get the following error:

wrong type for argument 6 of function call: char, expected json

I also tried setObject to no avail. My assumption was that I could pass a String containing valid JSON, and the driver would convert it to the correct type under the hood, but it doesn't seem to be supported at all.

Reproducible: Always

Comment 25604

Date: 2017-08-31 18:51:24 +0200
From: MonetDB Mercurial Repository <>

Changeset 8ea360b612de, made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the monetdb-java repo, refers to this bug.

For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=8ea360b612de

Changeset description:

Corrected PreparedStatement methods setString(int, String) and setObject(int, Object, ...) in case the target parameter data type was json or inet or url or uuid.
This fixes bug #6382.
Also added java test program.

Comment 25606

Date: 2017-08-31 19:12:21 +0200
From: MonetDB Mercurial Repository <>

Changeset 3ef07832d018 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3ef07832d018

Changeset description:

Activating java test program Bug_PrepStmtSetString_6382 for bug #6382

Comment 25811

Date: 2017-10-26 15:44:10 +0200
From: Martin van Dinther <<martin.van.dinther>>

New JDBC driver monetdb-jdbc-2.27.jar has been released

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

Successfully merging a pull request may close this issue.

None yet
1 participant