title: how to solve org.hibernate.MappingException: No Dialect mapping for JDBC type: -4
body: <p>my query in the code is </p>
  
  <pre><code> ArrayList lst = genericDao.query("select * from fdfiles where fileid = " + fileId);
  </code></pre>
  
  <p>At this line i get the exception</p>
  
  <pre><code>Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -4
  </code></pre>
  
  <p>How do i over come the above exception.</p>
  
  <p>my hibernate has properties</p>
  
  <pre><code>&lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.cache.use_query_cache"&gt;false&lt;/prop&gt;
              &lt;prop key="hibernate.cache.use_second_level_cache"&gt;false&lt;/prop&gt;
              &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>the log file shows</p>
  
  <pre><code>java.lang.Exception: No Dialect mapping for JDBC type: -4; nested exception is org.hibernate.MappingException: No Dialect mapping for JDBC type: -4
  at com.duncansolutions.databus.dao.GenericDao.query(GenericDao.java:135)
  at com.duncansolutions.databus.service.mechanismmanagement.datakey.FileListByLocationDaoService.getFile(FileListByLocationDaoService.java:151)
  at com.duncansolutions.databus.html.DatakeyFileDownloadController.getFilebyId(DatakeyFileDownloadController.java:34)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:174)
  </code></pre>