I'm using MS SQL Server XE 2005 and using Hibernate 3.2.2 to fetch DB rows. I've tried JDBC drivers provided by Microsoft as well as jTDS but all I get is an empty list.
Here is my hibernate configuration file.
Am I missing something here?
And my hbm mappings are
The output that I always get is
Also, I have successfully retrieved the result sets using plain JDBC
umar ali karimi wrote:No there is no error.
But when I use MySQL, I can see expected results.
It seems there's a communication gap between Hibernate and SQL Server Express Edition(2005/2008).
I tried with both of them on Windows 7 x64 bit platform but in vain.
So probably the error is in the hibernate.cfg.xml or in the driver.
The additional properties are schema and catalog
Hibernate mappings for SQL Server do not require these. These are required because of the user you connect to your database as. If you use Windows Integrated authentication you do not connect to any particular schema so you need to tell SQL Server which one you are using. If you had conencted using SQL Server authentication you would not need these properties.
Why does not hibernate report any exception like "table or view" does not exist if it is not aware of the schema and catalog and simply returns an empty list. [
This is a detail of how SQL Server is implemented, its not Hibernate. Had it been Oracle and you connected with a user who could not see your department table you would get an error.