Jsp problems   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkTechnology - Talk Only Tech � Jsp problems Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of pageLink to this message

Eeidlagolayenti
Pilla Bewarse
Username: Eeidlagolayenti

Post Number: 369
Registered: 03-2005
Posted From: 65.115.93.118

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 4:42 pm:Edit PostDelete PostView Post/Check IP

OK. may be its a timed out question, and assuming the recordset is resultset and will not be used for anything else,

if its not a problem,


just extract all of the ids and add them to a Vector(before adding it, check if it already contains the element) dont add if it already has it.

At the end the size of the vector is the unique ids.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Eeidlagolayenti
Pilla Bewarse
Username: Eeidlagolayenti

Post Number: 368
Registered: 03-2005
Posted From: 65.115.93.118

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 4:28 pm:Edit PostDelete PostView Post/Check IP

small question after all this discussion..

is that recordset or resultset? just wondering if it is resultset!!
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4813
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 3:04 pm:Edit PostDelete PostView Post/Check IP

java lo alanti api emi ledu kr mama
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 442
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 3:00 pm:Edit PostDelete PostView Post/Check IP

J2EE mama TIF maya emi anna api's unnaya anni asking from java , for the calculation.

Instead of quick sort and looping , i would suggest another call to the database provided database call is not costly.

TIF maya

looping and database call rendu try cheyyi. Dentlo ekkuva time teesukunte dani eliminate cheyyi.
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4812
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:57 pm:Edit PostDelete PostView Post/Check IP

Kr mama we have to implement the quick sort algo instead of using from the data structure thats what i mean any how if the requirement is just to get the count db query is better option
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 441
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:51 pm:Edit PostDelete PostView Post/Check IP

J2EE mama i know quick sort is faster, but here we are trying to eliminate the looping of the recordset.

The final goal is to find the number of unique ID's right.

If you use the default quicksort algorithm provided by the STL equivalent of Java it still takes in a recordset and returns you the sorted recordset but not the unique ID's Count.
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4811
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:48 pm:Edit PostDelete PostView Post/Check IP

kr mama quick sort is faster and while sorting as we do comparision that it self will let us know how many are distinct and how many are not
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 440
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:47 pm:Edit PostDelete PostView Post/Check IP

SORT chesina loop cheyyali kada..sorting lo emi anna distinct rows count isthunda.
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4810
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:46 pm:Edit PostDelete PostView Post/Check IP

otherwise use quick sort algorithm
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 438
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:45 pm:Edit PostDelete PostView Post/Check IP

java API..recordset object emi anna functions provide chesthunda...

.Net lo dataset aithe select clause untundi , so danitho pani kancheyyochu..
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4809
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:45 pm:Edit PostDelete PostView Post/Check IP

tiff mama iterating it through it is pain if the record set size increases. If you aim is just to get the count directlt fire the query i gave through the jdbc as you are doing to get the data. If not execute another query
Top of pagePrevious messageNext messageBottom of pageLink to this message

Tifosi
Mudiripoyina Bewarse
Username: Tifosi

Post Number: 4777
Registered: 03-2004
Posted From: 208.37.228.208

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:44 pm:Edit PostDelete PostView Post/Check IP

java record set mamalu...poni...oka algorithm icchina chalu...

its not DB related...

right now im sorting on the recordset on the ID...im instantiating two variables...one for the count and the other a temp variable to comare the next value....

im iterating through it in a foreach loop...

denikanTe better solution unTe cheppanDi...using java API
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 437
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:43 pm:Edit PostDelete PostView Post/Check IP

database ki malli vellanu ante, Loop cheyyali thru the current recordset. okkate solution..
Top of pagePrevious messageNext messageBottom of pageLink to this message

Vision
Pilla Bewarse
Username: Vision

Post Number: 436
Registered: 06-2005
Posted From: 192.63.80.98

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:42 pm:Edit PostDelete PostView Post/Check IP

Inko query fire cheyyi to the database with a distinct clause added to the query that returned you the earlier recordset.

A recordset count ento choodu ..
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4808
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:41 pm:Edit PostDelete PostView Post/Check IP

sorry replace unique with distinct
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4807
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:41 pm:Edit PostDelete PostView Post/Check IP

select count(unique(ids)) from some table
Top of pagePrevious messageNext messageBottom of pageLink to this message

Truecolours
Celebrity Bewarse
Username: Truecolours

Post Number: 6167
Registered: 11-2004
Posted From: 12.153.145.6

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:40 pm:Edit PostDelete PostView Post/Check IP

sort seyyu mamaa....
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Mudiripoyina Bewarse
Username: J2ee

Post Number: 4806
Registered: 08-2004
Posted From: 198.203.175.175

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:40 pm:Edit PostDelete PostView Post/Check IP

Tif mama record set antunaavu malli jsp antunaavu can u elobarate more?
Top of pagePrevious messageNext messageBottom of pageLink to this message

Onlybooth
Yavvanam Kaatesina Bewarse
Username: Onlybooth

Post Number: 1206
Registered: 06-2004
Posted From: 216.59.202.160

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:39 pm:Edit PostDelete PostView Post/Check IP

restart
Top of pagePrevious messageNext messageBottom of pageLink to this message

Tifosi
Mudiripoyina Bewarse
Username: Tifosi

Post Number: 4776
Registered: 03-2004
Posted From: 208.37.228.208

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, June 27, 2005 - 2:38 pm:Edit PostDelete PostView Post/Check IP

i have a record set with a list of IDs...i want to know if there are more than 10 unique IDs...how can I do it with the least complexity and cycle time?