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 )
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