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

is there something called database programming

 
alsoumahi alBatal
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
Carlo Moore
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic