i have 2 databases for testing: 1x MySQL, 1x MS SQL Server 2008
both DBs have the table called "user"
in MySQL, "select * from user" works
in MS SQL, it has to be "select * from [user]"
i though that Hibernate can do it from itself... but when i want to get the users on the MS SQL Server, Hibernate still creates this statement:
Code:
Hibernate: select user0_.uid as uid1_, user0_.BEGROUP as BEGROUP1_, BLAH BLAH BLAH from .user user0_
...causing an SQL-Error
my java-code has to work with both DBs ... MySQL AND MS SQL ... (otherwise hibernate makes no sense for our project)
can anyone help me out?
greetings
lenaz
edit:
here's my hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="connection.url">
jdbc:sqlserver://192.xxx.xxx.xxx:1433;databaseName=adb;
</property>
<property name="connection.username">****</property>
<property name="connection.password">****</property>
<property name="connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="hibernate.c3p0.min_size">0</property>
<property name="hibernate.c3p0.max_size">30</property>
<property name="hibernate.c3p0.timeout">600</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">60</property>
<property name="hibernate.c3p0.preferredTestQuery">SELECT 1;</property>
<property name="connection.autocommit">true</property>
<property name="connection.zeroDateTimeBehavior">convertToNull</property>
<property name="connection.jdbcCompliantTruncation">false</property>
<property name="connection.autoReconnect">true</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="hibernate/mappings/Angebot.hbm.xml" />
<mapping resource="hibernate/mappings/User.hbm.xml" />
</session-factory>
</hibernate-configuration>