Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting data from mutiple tables

 
adithi shashishekar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am converting a servlet based application to struts framework.I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .

Please let me know the best way to query the tables.Here are the queries.



Select a.proj_id , a.proj_nm
From stn_proj_et a, stn_proj b
Where a.proj_id = b.proj_id
And a.sftwr_id = 24
And b.stn_id = bst_id

Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
From stn_loc_hist
Where stn_id =bst_id
And cur_use_cd = 1

select data_tp_cd
from data_coll_summ
where stn_id =bst_id
And rownum < 2;

select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
from stn_et
where stn_id = bst_id
select
distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
from stn_et;

select
distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
from stn_et;

select distinct PROJ_NM from stn_proj_et where sftwr_id=24;

Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
From stn_alias_nm a, alias_orgn_et b
Where a.alias_orgn_id = b.alias_orgn_id
And b.alias_orgn_tp = 0
And stn_id = bst_id;
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your application's database code must be rewritten to adopt Struts in place of raw servlets, I'd contend that your app is very badly structured. The Model and persistence code should be completely independent of the UI code.

If you are refactoring the app, now is the time to get into an accepted best-practice structure.
[ August 01, 2008: Message edited by: Bear Bibeault ]
 
arun nohwar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use PooledConnection and ConnectionPoolDataSource.

1. If you use 1 pooled connection then all your 7(no of your tables) database requests are sequential.

2. If you use 7 pooled connection objects, then it is database access time hit.

Any java oriented solution is not better than database stored procedure/database object solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic