On Thursday, June 7, 2018 at 7:09:36 PM UTC-7, ELMER IBAYAN wrote:
>
> Hi Jeremy,
>
> We are using JDBC:MSSQL driver and I realise there's a similar question 
> posted here at StackOverflow 
> <https://dba.stackexchange.com/questions/44372/is-there-any-way-to-retrieve-messages-in-sql-server-through-jdbc>
>  
> :  
> I think the way it's getting it from JDBC is thru Statement.getWarnings() 
> like this:
>
> Statement stmt = ...;
> stmt.execute("some_procedure");
>
> SQLWarning warning = stmt.getWarnings();
> while (warning != null){
>    System.out.println(warning.getMessage());
>    warning = warning.getNextWarning();}
>
>
> I am not sure if there's an equivalent method in Sequel that we can use in 
> order to implement capturing of this warning message. In my application, I 
> am using "fetch" command which returns single "result_set" all the time. 
>

There currently isn't a method in Sequel to get these warnings.  Based on 
the fact that nobody has requested this feature in 10 years, it seems like 
it isn't needed often, and as such it doesn't make sense to include support 
in the jdbc adapter itself, though I'd be open to supporting it via an 
extension that ships with Sequel.  If you'd like to see that, please submit 
a pull request that adds such an extension along with appropriate 
integration tests.

My guess is the easiest way to implement this is to override 
Sequel::JDBC::Database#statement, but you'll have to decide on an 
appropriate API.  It would probably be best to be able to set a callable 
object that gets called with all JDBC warning messages, as that is the most 
flexible way to handle it.
 

> Additional question I have is that is there a way to detect presence of 
> multiple result set? 
>

No. Having a dataset return multiple result sets is not supported by Sequel.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to