Routines not generating for stored procedure in Sybase DB

69 views
Skip to first unread message

know...@googlemail.com

unread,
Nov 5, 2015, 6:43:30 AM11/5/15
to jOOQ User Group
Hi,

I am trying to generate a schema from a Sybase database. The tables are able to generate just fine but none of the stored procedures generate an equivalent routine type.

What could be causing this? I am using Jooq 3.4.2 and net.sourceforge.jtds.jdbc.Driver driver. Here is an extract of my pom generation:

 <configuration>
                    <jdbc>
                        <driver>${driver}</driver>
                        <url>${db.url}</url>
                        <user>${db.username}</user>
                        <password>${db.password}</password>
                    </jdbc>

                    <generator>
                        <database>
                            <name>org.jooq.util.jdbc.JDBCDatabase</name>
                            <includes>.*</includes>
                            <inputSchema>dbo</inputSchema>
                        </database>
                        <target>
                            <packageName>org.jooq.example.flyway.db.h2</packageName>
                            <directory>target/generated-sources/jooq-h2</directory>
                        </target>
                    </generator>
                </configuration>
            </plugin>
...

Can someone provide more insight as to what I am doing wrong?

Thanks,

Noman

Lukas Eder

unread,
Nov 5, 2015, 7:05:16 AM11/5/15
to jooq...@googlegroups.com
Hello Noman,

What Sybase database are you using? Adaptive Server or SQL Anywhere? Currently, source code generation is available only for SQL Anywhere, not for Adaptive Server. Specifically, the JDBCDatabase doesn't support stored procedures.

We have a pending feature request to add stored procedure support for Adaptive Server:

Unfortunately, it seems as though it is non-trivial to discover them from meta data, which is why we haven't added such support yet.

Hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

know...@googlemail.com

unread,
Nov 5, 2015, 8:16:48 AM11/5/15
to jOOQ User Group


Hi Lukas,

I am indeed using Adaptive Server. Is there a workaround? Is there anything in the Jooq libraries which can wrap a callablestatement and its resultset? Ideally as a workaround, I want to dynamically create a callablestatement and couple my interface to jooq.

Also, is there an ETA of when this enhancement will be released?

Many Thanks!

Noman

Lukas Eder

unread,
Nov 10, 2015, 8:58:41 AM11/10/15
to jooq...@googlegroups.com
Hi Noman,

You can always use plain SQL to call stored procedures that return cursors, e.g. via the DSLContext.fetchMany() method:

It will return a Results object, which is a convenient combination of result sets and update counts:

This doesn't work for CallableStatements, though, only for PreparedStatements. There is currently no way to register OUT parameters to plain SQL calls in jOOQ.

I'm sorry I currently cannot give you an ETA for this feature, but we'll keep you posted on our further research.

Best Regards,
Lukas
Reply all
Reply to author
Forward
0 new messages