Getting Exception No Dialect mapping for JDBC type
<p>I am new to hibernate and java. I'm trying to execute native sql query but I have been stuck. Can anyone can help me out or check where I'm doing mistake?</p>

<p><em>My java code is</em> :</p>

<pre><code>try {
            trns = session.beginTransaction();
            String sql = "select principle,interest from salaryinfo where empid = " + selectedempid + "";
            SQLQuery query = session.createSQLQuery(sql);
            List&lt;Object[]&gt; rows = query.list();
            for (Object[] row : rows) {
                Salaryinfo si= new Salaryinfo();
                si.setPrinciple(Float.parseFloat(row[0].toString()));
                si.setInterest(Float.parseFloat(row[1].toString()));
                sis.add(si);
            }
</code></pre>

<p><em>Error Trace</em>:</p>

<pre><code>Severe:   org.hibernate.MappingException: No Dialect mapping for JDBC type: 7
    at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
    at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
    at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:192)
    at org.hibernate.loader.custom.CustomLoader.getHibernateType(CustomLoader.java:161)
    at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:131)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1678)
    at org.hibernate.loader.Loader.doQuery(Loader.java:662)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2145)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
    at org.hibernate.loader.Loader.list(Loader.java:2024)
    .
    .
    .
    .
</code></pre>

<p>I did debug my program and found my program is breaking is on this line <code>SQLQuery query = session.createSQLQuery(sql);</code></p>

<p>Hibernate config file :</p>

<pre><code>&lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
        &lt;property name="hibernate.bytecode.use_reflection_optimizer"&gt;false&lt;/property&gt;
        &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
        &lt;property name="hibernate.connection.password"&gt;****&lt;/property&gt;
        &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/empdata&lt;/property&gt;
        &lt;property name="hibernate.connection.username"&gt;****&lt;/property&gt;
        &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLInnoDBDialect&lt;/property&gt;

        &lt;property name="hibernate.show_sql"&gt;false&lt;/property&gt;
    &lt;property name="hibernate.format_sql"&gt;false&lt;/property&gt;
    &lt;property name="hibernate.cache.use_query_cache"&gt;true&lt;/property&gt;
    &lt;property name="hibernate.c3p0.acquire_increment"&gt;1&lt;/property&gt; 
    &lt;property name="hibernate.c3p0.idle_test_period"&gt;10&lt;/property&gt; &lt;!-- seconds --&gt;             
        &lt;mapping resource="hibernate/Salaryinfo.hbm.xml" /&gt;   

    &lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</code></pre>