2

The below question and answer is perfect for answering this question for almost any database except for Sybase ASE (SAP ASE): Efficient SQL test query or validation query that will work across all (or most) databases

What is a suitable setting for ASE ? I'm using ASE 16 with driver:

spring.datasource.driver-class-name=com.sybase.jdbc4.jdbc.SybDriver

pom:

    <dependency>
        <groupId>com.sybase</groupId>
        <artifactId>jconn4</artifactId>
        <version>16</version>
    </dependency>

From the error below it appears to be expecting a stored procedure, however when I try an existing sproc (as appose to "SELECT 1") it doesn't work either

HikariPool-1 - Failed to execute connection test query (Stored procedure '"SELECT 1"' not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

app properties:

spring.datasource.hikari.connection-test-query="SELECT 1"
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Jim
  • 45
  • 1
  • 1
  • 8

1 Answers1

2

In Sybase ASE select can be without where or from clause

A simple select statement contains only the select clause; the from clause is almost always included, but is necessary only in select statements that retrieve data from tables. All other clauses, including the where clause, are optional.

So you can just use Select 1 removing the double quotes as in example

connection-test-query: SELECT 1

Ori Marko
  • 56,308
  • 23
  • 131
  • 233