Search code examples
javasap-asejooq

Error when generating meta model code with JOOQ from SYBASE DB


I have this error when trying to generate the meta model with JOOQ:

org.jooq.exception.DataAccessException: SQL [select [SYS].[SYSUSER].[user_name] from [SYS].[SYSUSER]]; SYS.SYSUSER not found.

It's probably because the user does not have administration rights. Can JOOQ generate metamodel code from create statements? I don't have another user. Any suggestions?


Solution

  • You're probably using the wrong database as understood by jOOQ, as documented here:

    http://www.jooq.org/manual/META/Configuration/

    Note, how the documentation states:

    <!-- The database dialect from jooq-meta. Available dialects are
         named org.util.[database].[database]Database. Known values are:
    
         org.jooq.util.ase.ASEDatabase
         [...]
         org.jooq.util.sybase.SybaseDatabase
    
         You can also provide your own org.jooq.util.Database implementation
         here, if your database is currently not supported -->
         <name>org.jooq.util.oracle.OracleDatabase</name>
    

    The SQL you've mentioned seems to be from the SybaseDatabase class (which corresponds to Sybase SQL Anywhere), whereas you should use the ASEDatabase class instead, generating calls to sp_help