• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is there something called database programming

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi experts , I am right now running on project that needs to retrieve big resultset from database . Actually I am using mysql database for my project and java as my programmong language where I
make my quries there. My problem is that when I retrieve information from database in java (As a result set) then I make some filtering/examining data on the result set , it takes too much time for program to examine ( record after record ). Therefore , what I am thinking is to make a programming query (already it has final result set , no need to do further process on it ) , so it will be only launch that query and
get the result( because executing query and retrieve it from database takes much faster time )

I have already searched about that , I got only way is through stored procedure . however stored procedure has less capablities to perform such programming process like to store a result set in
a temporary variable , etc...



what shall I do , any suggestion ?

thanks in a advance
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using a where clause to limit the result set to only rows in which you are interested?

If you're grabbing them all and filtering them in Java code, well yeah, that's gonna be slow.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you need to filter results in the query itself, however there is a lot you can do with a stored proc...if you really need to.
Stored procs can take parameters. I've not too much experience with mySQL, but Oracle stored procs are really powerful.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stored procedures have variables/intermediate result sets too. Anything that can be done in a where clause should rather than filtering after though because it gives the database less work/processing/IO.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic