2

i am new to hibernate and need to configure it for MS SQL-server 2012 standard. i found this deprecated article how to configure hibernate config file for sql server but i need a new one. where i can find the driver for the new database (if there is any)! thanks for answers

4
  • What's the first result when you google for "MS SQL-server 2012 JDBC driver"? Commented Nov 3, 2012 at 17:37
  • yeah, but whats the dialect? is the sql server 2012 supported? the driver you can find here microsoft.com/de-de/download/details.aspx?id=11774 Commented Nov 4, 2012 at 13:36
  • the dialect should be Microsoft SQL Server - org.hibernate.dialect.SQLServerDialect but a new one would be cool... and the server is not officialy tested Commented Nov 4, 2012 at 13:41
  • 1
    I don't know, but I would bet that the SQLServer2008Dialect is the one to use. I guess MS didn't revolutionize its SQL syntax, and kept backward compatibility. If there are problems, you can still use your own dialect that extends this one. Commented Nov 4, 2012 at 13:42

3 Answers 3

1

I was able to get it working with Microsoft JDBC Driver 4.0 for SQL Server as seen here.

jTDS didn't work although it had previously worked with the same settings on SQL Server 2008 R2.

A couple config lines which MS JDBC 4.0 requires.

jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost:1433;
Sign up to request clarification or add additional context in comments.

Comments

1

No need to give the user,password and database name in separate property tags,you can keep all of them inside url named proprety tag. Inside Hibernate configuration file you can write like this:-

<property name="connection.url">jdbc:sqlserver://myhost;user=user1;password=pass1;database=Student1</property>

where user1,pass1,myhost and Student1 are my credential, you can replace them by yours.

Comments

-3

to close the question: i am using oracle now. not because ms is not working... the upper config could work...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.