aspose file tools
The moose likes JDBC and the fly likes is there something called database programming Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "is there something called database programming" Watch "is there something called database programming" New topic
Author

is there something called database programming

alsoumahi alBatal
Ranch Hand

Joined: Nov 22, 2009
Posts: 84
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

Joined: Jan 10, 2002
Posts: 56162
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Carlo Moore
Greenhorn

Joined: Aug 02, 2005
Posts: 27
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 26155
    
  66

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is there something called database programming
 
Similar Threads
Regarding the SQL querry generation
best programming practises of JDBC
Stored Procedure Problem
Learning At any level
Adding Indexes is causing Poor Performance