I am facing problem connecting DB2 with hibernate .
Error:-
org.hibernate.HibernateException: No DatabaseDialectMapper known for database [DB2/LINUXX8664]
My configuration is:-
String url="jdbc:db2://10.4.0.71:50000/"+databasename2+":retrieveMessagesFromServerOnGetMessage=true;securityMechanism=3;";
try {
cfg = new Configuration()
//add these resources from property file
.addResource(ReadProperty.dictProjectVar.get("hbmFilePath"))
.setProperty("dialect","org.hibernate.dialect.DB2Dialect")
.setProperty("hibernate.connection.driver_class", "com.ibm.db2.jcc.DB2Driver")
.setProperty("hibernate.connection.username","db2inst1")
.setProperty("hibernate.connection.password","Pyramid123")
.setProperty("hibernate.connection.url", url)
.setProperty("hibernate.connection.pool_size", "5")
.setProperty("hbm2ddl.auto", "create")
.setProperty("show_sql","true");
}
catch(Exception e) {
e.printStackTrace();
}
I have added the db2jcc and the db2jcc4 jar to my class path. DB is installed on an ubuntu machine and is a trial version.
Thanks, Aditya