cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting Liquibase with SQL Anywhere 17

2,196

I already downloaded liquibase-4.0.0-beta1 and I'm looking to set it up with an existing SQL Anywhere 17 database. I've tried running the following command:

liquibase --driver=com.sybase.jdbc4.jdbc.SybDriver --classpath=jconn4-4.0.0.jar --changeLogFile=testInitialChangelog.sql --url="jdbc:sqlanywhere:uid=dba;pwd=sql;eng=test123456;PreventNotCapable=y" --logLevel=debug generateChangeLog

The output is: [2020-05-12 12:05:59] INFO [liquibase.integration] No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro features. Liquibase Community 4.0.0-beta1 by Datical Starting Liquibase at 12:05:59 (version 4.0.0-beta1 #6 built at 2020-04-20 18:23+0000) Unexpected error running Liquibase: liquibase.exception.DatabaseException: Connection could not be created to jdbc:sqlanywhere:uid=dba;pwd=sql;eng=test123456;PreventNotCapable=y with driver com.sybase.jdbc4.jdbc.SybDriver. Possibly the wrong driver for the given database URL For more information, please use the --logLevel flag [2020-05-12 12:06:00] SEVERE [liquibase.integration] Unexpected error running Liquibase: liquibase.exception.DatabaseException: Connection could not be created to jdbc:sqlanywhere:uid=dba;pwd=sql;eng=test123456;PreventNotCapable=y with driver com.sybase.jdbc4.jdbc.SybDriver. Possibly the wrong driver for the given database URL liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:sqlanywhere:uid=dba;pwd=sql;eng=test123456;PreventNotCapable=y with driver com.sybase.jdbc4.jdbc.SybDriver. Possibly the wrong driver for the given database URL

I have not found information about the connection string (URL) for SQL Anywhere, can anyone help me in what I am doing wrong?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

chris_keating
Product and Topic Expert
Product and Topic Expert

I have no knowledge of or experience with Liquibase. There are two supported JDBC drivers for SQL Anywhere. 1. The SQL Anywhere JDBC driver (sajdbc4.jar); 2. jConnect (jconn4.jar).

It appears that you might be using a jConnect driver (although the jar name is not what I expect).

If using jConnect, the URL you are using is incorrect. It should be of the form:

jdbc:sybase:Tds:<machine_name_or_ip>:<database_server_port>

The URL that is reported in the error is for the SQL Anywhere JDBC driver. Unless you have a preference for a Type 4 driver, I would recommend using SQL Anywhere JDBC.

Yes, you were right, I was trying both and mix the URL.

It looks like it worked like this: liquibase --driver=sap.jdbc4.sqlanywhere.IDriver --classpath=sajdbc4.jar --changeLogFile=testInitialChangelog.asany.sql --url="jdbc:sqlanywhere:uid=dba;pwd=sql;eng=test123456;PreventNotCapable=y" --username="dba" --password="sql" --defaultSchemaName=dbo --logLevel=debug generateChangeLog

I will continue playing with this, thanks for your comment.