I have a database that I am running locally with SQL Anywhere Personal Server Version 16 on OS X. The server name is "test" and the database name is "mydatabase". I am trying to connect to the database with a java application using hibernate, and having difficulty with the configuration.
I downloaded the jConnect driver jconn4 from the SAP Adaptive Server Enterprise 16 SDK and added it to my classpath. Using Hibernate 5, my configuration xml file has the following settings:
<propertyname="connection.driver_class">com.sybase.jdbc4.jdbc.SybDriver</property>
<propertyname="connection.url">jdbc:sybase:Tds:localhost:2638</property>
<propertyname="connection.username">myuser</property>
<propertyname="connection.password">temppwd</property>
<propertyname="hibernate.connection.JCONNECT_VERSION">7</property>
<propertyname="hibernate.connection.DATABASE">mydatabase</property>
<propertyname="hibernate.connection.DYNAMIC_PREPARE">true</property>
<propertyname="hibernate.jdbc.batch.builder">org.hibernate.dialect.sqlanywhere.JConnBatchBuilderImpl</property>
<!-- SQL dialect -->
<propertyname="hibernate.dialect">org.hibernate.dialect.SQLAnywhere16Dialect</property>
<!-- Enable Hibernate's automatic session context management -->
<propertyname="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<propertyname="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<propertyname="show_sql">true</property>
However, it's unable to connect. Specifically, the exception is caused by:
Caused by: java.sql.SQLException: JZ006: Caught IOException: java.net.ConnectException: Connection refused
Which tells me I don't have something set up right with the connection string. I've been looking through documentation for awhile and finding a lot of conflicting information. Can anyone advise what is wrong?