Menu

Getting a SQL Server error when trying to run a query on a Sybase server with the jtds driver

Help
1derer
2016-12-20
2017-01-12
  • 1derer

    1derer - 2016-12-20

    Hello.

    I'm using the jtds-1.3.1.jar driver to connect to a Sybase ASE 15.7 intance on Linux RHEL, and I'm getting the following error:

    Java::JavaSql::SQLException: Function 'SERVERPROPERTY' not found. If this is a SQLJ function or SQL function, use sphelp to check whether the object exists (sphelp may produce a large amount of output).: SELECT CAST(SERVERPROPERTY('ProductVersion') AS varchar) {:level=>:error, :file=>"sequel/database/logging.rb", :line=>"72", :method=>"logeach"}
    

    These are the parameters I'm using to call the driver (masking irrelevant info. with "<...>"):

    jdbc_driver_library => "<full_path>/lib/jtds-1.3.1.jar"
    jdbc_driver_class => "Java::net.sourceforge.jtds.jdbc.Driver"
    jdbc_connection_string => "jdbc:jtds:sybase://<host>:<port>/master"
    

    I searched for the SERVERPROPERTY function and it turns out it's a SQLServer function and not Sybase ASE one. I already know this function doesn't exist in the Sybase server I'm running this query on, but I don't get why the driver is trying to execute SQLServer recursive queries instead of Sybase ones if I'm clearly asking it to connect to a Sybase server (line 3 of the previous snippet).

    What puzzles me even more is that this whole same configuration is running correctly on another Sybase server I have, only that I haven't been able to spot any differences between the two environments yet (so far same O.S., DB, Java, JTDS and client versions on both).

    What am I missing? Any help is appreciated. Thanks.

     

    Last edit: 1derer 2016-12-20
  • PhaedrusTheGreek

    I'm also hitting this problem under Logstash with JTDS 1.3.1 - any solution yet?

     

    Last edit: PhaedrusTheGreek 2017-01-12

Log in to post a comment.