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.  [ 1 post ] 
Author Message
 Post subject: Oracle + Hibernate question
PostPosted: Fri Jul 02, 2010 3:45 am 
Newbie

Joined: Fri Jul 02, 2010 3:39 am
Posts: 1
Example I have Oracle table with CHAR and NUMBER fields.
ID NUMBER(1)
PASSWORD CHAR(3)
NAME VARCHAR2(4)

and data is
ID PASSWORD NAME
1 passwd test

When I execute following query by using hibernateTemplate.execute

"select id, password, name from test_table"

my return is
"null" "null" "test"
If I edit query like this "select trim(id), trim(password), trim(name) from test_table"
This returns correct result
"1" "passwd" "test"

question is why CHAR and NUMBER fields returns NULL without trim?

One more question is when I execute following query "select * from test_table" can I get all columns name (means column metadata)?


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

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.