Hello
I'm working with mysql 5 / jboss4.2.2/EJB3/JDK6
I want from a nativequery read a field of CHAR(n) in a database, when I user varchar , it
s works, but if i use char(n), I always get a Character instead of a String.
| CREATE TABLE testchar(
| myid CHAR(2) PRIMARY KEY
| )
When i user native query to retrive data then I get a java.lang.Character instead of a
String.
| q=em.createNativeQuery("SELECT myid FROM testchar");
| q.setMaxResults(2);
| List<Object[]> r= q.getResultList();
| log.info("class="+ r.get(0).getClass()+" "+r.get(0));
| -->return java.lang.Character and value is the first character of the row
There is someone who have an idea of what is wrong?
Thanks
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251037#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...