Hi All,
I'm using hibernate 3.1 with MaxDB 7.5.00.
When I try to execute query "select count(*) from the_table" using createSQLQuery, I get an exception: "No Dialect mapping for JDBC type: 3".
I've googled for the SAPDBDialect source. The constructor there looks like this:
Code:
public SAPDBDialect() {
super();
registerColumnType( Types.BIT, "boolean" );
registerColumnType( Types.BIGINT, "fixed(19,0)" );
registerColumnType( Types.SMALLINT, "smallint" );
registerColumnType( Types.TINYINT, "fixed(3,0)" );
registerColumnType( Types.INTEGER, "int" );
registerColumnType( Types.CHAR, "char(1)" );
registerColumnType( Types.VARCHAR, "varchar($l)" );
registerColumnType( Types.FLOAT, "float" );
registerColumnType( Types.DOUBLE, "double precision" );
registerColumnType( Types.DATE, "date" );
registerColumnType( Types.TIME, "time" );
registerColumnType( Types.TIMESTAMP, "timestamp" );
registerColumnType( Types.VARBINARY, "long byte" );
registerColumnType( Types.NUMERIC, "fixed(19,$l)" );
registerColumnType( Types.CLOB, "long varchar" );
registerColumnType( Types.BLOB, "long byte" );
getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE);
}
There really is not defined a mapping for type 3, which is Types.DECIMAL. So, I defined my own dialect:
Code:
public class CustomSAPDBDialect extends SAPDBDialect {
public CustomSAPDBDialect() {
super();
registerColumnType(Types.DECIMAL, "int");
}
}
EAR deploying log excerpt:
Code:
14:33:26,067 INFO [SettingsFactory] RDBMS: SAP DB, version: Kernel 7.5.0 Build 024-000-000-000
14:33:26,067 INFO [SettingsFactory] JDBC driver: SAP DB, version: package com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL MaxDB, 7.6.0 Build 016-000-004-753
14:33:26,078 INFO [Dialect] Using dialect: com.smartphonelabs.portal.util.CustomSAPDBDialect
However, I still get the No Dialect Mapping exception. :| Can someone help me to resolve the issue?
Thanks, Jlexa