-->
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.  [ 2 posts ] 
Author Message
 Post subject: Sybase 12.5, JDBC driver3 text and long varchar field issue
PostPosted: Tue May 01, 2007 9:59 am 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
Hibernate version: 3.2.3
Database: Sybase 12.5
DBC Driver: jconn3 (jConnect for JDBC 3.0 version 6.0 Build (25828))

When the hibernate query retrieves the text column or the varchar column of size greater than 255, we get the following exception.

Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
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:369)

It happens because the jdbc driver returns the sql type of column as -1 (LONGVARCHAR), but there is no mapping define in the file org.hibernate.dialect.SybaseDialect for the sql type -1.

In our hibernate mapping files, all these columns are mapped to Hibernate.STRING

We created our own Dialect which drives from org.hibernate.dialect.Sybase11Dialect. All we have in derived class is the constructor which contains the following:

super();
registerHibernateType( Types.LONGVARCHAR, Hibernate.STRING.getName() );
registerColumnType( Types.LONGVARCHAR, "varchar($l)" );

Basically we are treating the LONGVARCHAR same as VARCHAR.

We just wanted to find out if any one else is doing it or there is a better way.

Appreciate all responses


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 10:58 am 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
Posted in wrong thread. Sorry! :x

_________________
Everytime you get an answer to your question without giving credit; god kills a kitten. :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.