-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: No Dialect mapping for JDBC type: -1
PostPosted: Wed Sep 12, 2007 8:45 am 
Newbie

Joined: Wed Sep 12, 2007 8:34 am
Posts: 1
Location: Bombay (India)
Hi
I am using Hibernate version: 3.2 and Name and
version of the database: MySQL 5.0.45win32

my code is as follows:
public List retrieveValues(String sqlData, String tableName) {

Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();

String queryString = "Select "+ sqlData +" FROM " + tableName + ";";

List result = session.createSQLQuery(queryString).list();

session.getTransaction().commit();

HibernateUtil.getSessionFactory().close();

return result;
}


This code written in OTAServerManager.java and i am calling method retrieveValues("*", "databasename") then i am getting following error.
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1

What should i do for this?

Thanks in advance, I am new for Hibernate this is my first programme.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 6:05 am 
Beginner
Beginner

Joined: Tue Jan 18, 2005 9:37 am
Posts: 29
Location: The Netherlands
Hi,

I had the same problem and it was caused by the fact that I queried a column of type 'text'. Apparently hibernate cannot map this JDBC type to a java type.

Try it without the text column and you will see that it works.

Bas


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 6:48 am 
Beginner
Beginner

Joined: Tue Jan 18, 2005 9:37 am
Posts: 29
Location: The Netherlands
workaround: map the columns explicit with addScalar.
see also:
http://opensource.atlassian.com/project ... tion_28333


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 8:48 am 
Newbie

Joined: Mon Oct 01, 2007 8:59 am
Posts: 18
you can try by writing this code in hibernate.cfn.xml file it may resolve ur error "No Dialect mapping for JDBC type: -1"

<property name="dialect">org.hibernate.dialect.MySQLDialect</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.