I downloaded microsfot's jdbc driver, and I am not sure what the connection.url should be?
<property name="connection.driver_class">org.microsoft.sqlserver.jdbc</property>
<property name="connection.url">jdbc:</property>
..
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
i configured sqlexpress to work via tcpip and a static port already.
Here you go:
<property name = "hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name = "hibernate.connection.driver_class" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name = "hibernate.connection.url" value = "jdbc:sqlserver://localhost;databaseName=cust;instanceName=SQLEXPRESS;"/>
<property name = "hibernate.connection.username" value = "sa"/>
<property name = "hibernate.connection.password" value = ""/>
<property name = "hibernate.show_sql" value="true"/>
Connection strings are database dependent. You should take a look at a good reference web site.
If you're trying to connect to SQL Server from a Java application, try this:
jdbc:microsoft:sqlserver://<HOST>:<PORT>[;DatabaseName=<DB>]
com.microsoft.jdbc.sqlserver.SQLServerDriver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With