Hi,
I need to query oracle 10g and get order number using Hibernate.
for this i though of using native sql.
kept related HB jars in path along with ojdbc14.jar.
I tried using the following queries but could not get the order number through Hibernate.
But when i execute the below queries am getting the order number from SQL prompt.
Am using oracle 10g release 1 and Hibernate 3.2.6.
//String sql="select orderno from orders o where o.typec='s' and o.name='xxxx' and exists(select 'x' from source s where s.id=o.orderno)";
//String sql="select orderno from orders o,source s where o.typec='s' and o.name='xxxx' and s.id=o.orderno";
Scripts
create table orders(orderno number, typec varchar2(10), name varchar2(10));
insert into orders(orderno,typec,name) values(10,'s','xxxx');
insert into orders(orderno,typec,name) values(11,'k','pppp');
insert into orders(orderno,typec,name) values(12,'p','zzzz');
insert into orders(orderno,typec,name) values(13,'l','dddd');
create table source(id number,name varchar2(10));
insert into source(id,name) values(10,'XXXX');
insert into source(id,name) values(11,'zzzz');
insert into source(id,name) values(12,'kkkk');
When executed from SQL prompt.
select orderno from orders o where o.typec='s' and o.name='xxxx' and exists(select 'x' from sou
rce s where s.id=o.orderno);
ORDERNO
----------
10
Is there anything i am missing to keep in path or Hibernate 3.2.6 does not work with Oracle 10g properly.
Is Hibernate 3.2.6 works with Oracle10g.
Or i need to use any other ......?
This is working with MySql5.
I need this to work with Oracle.
Your help is greatly appreciated.
Thanks
|