Replies: 5 comments 4 replies
-
Hi @0x1F528, can you please share the declaration of your stored procedure? Ideally we could reproduce the issue ourselves, that will make fixing it easier. |
Beta Was this translation helpful? Give feedback.
-
This is an example with oracle and outparameters with cursors: https://github.com/jdbi/jdbi3-oracle12/blob/master/src/test/java/org/jdbi/v3/oracle12/TestOutparameterCursor.java Could you post the stack trace for the NPE? |
Beta Was this translation helpful? Give feedback.
-
I think you have the same problem as #2557; you need ResultBearing support directly from Call, not through OutParameters. There seems to be a relevant MS JDBC driver issue here: microsoft/mssql-jdbc#98 |
Beta Was this translation helpful? Give feedback.
-
So we will ship this as part of 3.43.0. See #2576 for details. This is the syntax:
See https://github.com/jdbi/jdbi/pull/2576/files#diff-055d1b639319e597ee5f82d94203df27bbd3aacb49c81570b0ba97168e3802fdR48-R62 for an actual test running against SQLServer. |
Beta Was this translation helpful? Give feedback.
-
Shipped as part of 3.43.0. Please test. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to use JDBI to retrieve a result set from a Stored Procedure but when I try accessing the data I get a null pointer exception. As far as I can tell from debugging and inspection the query result is indeed (unexpectedly) empty.
I am able to access the DB with query = handle.createQuery("SELECT * FROM Noodle") and retrieve a correct result set with query.mapToMap().list()
However, when I use query = handle.createCall("{call Noodle_Get (0, 1) }").invoke() the resulting query object doesn't contain a result set (or at least I haven't figured out how to access it - I get a null pointer exception somewhere down deep).
When I do EXEC Noodle_Get 0, 1 in Sql Server Manager I do get the expected result set.
I have also implemented the Stored Procedure access with straight JDBC and am able to pull the data. I am just not able to do it with JDBI.
Here is the relevant code:
` Map<String, Object> results2 = jdbi.withHandle(handle -> {
OutParameters query = handle.createCall("{call Noodle_Get (0, 1) }").invoke();
I am getting the NullPointerException when executing the resultIterable.findFirst()
Any suggestions what I should be looking for to resolve this?
I am using JDBI3-core version 3.41.3 and Java 17
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions