Author |
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: | |
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. |
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: | |
small question after all this discussion.. is that recordset or resultset? just wondering if it is resultset!! |
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: | |
java lo alanti api emi ledu kr mama |
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: | |
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. |
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: | |
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 |
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: | |
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. |
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: | |
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 |
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: | |
SORT chesina loop cheyyali kada..sorting lo emi anna distinct rows count isthunda. |
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: | |
otherwise use quick sort algorithm |
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: | |
java API..recordset object emi anna functions provide chesthunda... .Net lo dataset aithe select clause untundi , so danitho pani kancheyyochu.. |
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: | |
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 |
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: | |
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 |
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: | |
database ki malli vellanu ante, Loop cheyyali thru the current recordset. okkate solution.. |
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: | |
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 .. |
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: | |
sorry replace unique with distinct |
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: | |
select count(unique(ids)) from some table |
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: | |
sort seyyu mamaa.... |
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: | |
Tif mama record set antunaavu malli jsp antunaavu can u elobarate more? |
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: | |
restart |
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: | |
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? |