• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Selecting data from more than one table: I am getting exception

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,

I am usin Hibernate as JDBC. I want to select datas fro two tables.
For example the field names are datavalue and reportindex. I wish to take reportindex which is a PRIMARY KEY field of table: funnelguagemain and it is a FORIEGN KEY field of table: funnelguagecontens.

The data value field content coming under funnelguagecontents table. I wish to select the report index by some condition and accoring to that reportindexes I've select datavalue from funnelguage tables.
Thes getting values shoul be store in a single list.
In that list reportindex may repeat. Imeant the reportindex field is repeating in tne table report contents.

I tried in may ways, but I couldn't reach a solution can anybody help me..
please..
Tanks
-Arun
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am getting exception


And what is that exception?
 
Arun R. S. Chandran
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Different times I got different exceptions.
1. Right paranthesis missing
2. single query returns more than one row.

Like that I got exceptions.

But I correct allthose exceptions and I run the query It is running and not stopping. I more thing I am not using a loop.. Then Why it is not stopping .

The Query I wrot is given below

"Select new GuageReportdata(fgrc.datavalue,fgrc.funnelguagereportmain.reportindex)
from Funnelguagereportcontents fgrc, Funnelguagereportmain fgrm where fgrm.shopnumber=?
and fgrm.guagetype=? and to_char(fgrm.datetime,'DD-mm-yyyy hh24:mi:ss') between ? and ?
and fgrm.totalpoints > 0 and fgrm.entry1=? order by fgrm.reportindex desc

"

Thanks
-Arun
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic