How to increase the speed of searching in a large database?



Hi all,

I have a very big database that contains one million rows in it. After
an SQL command is executed and the results are assigned to a ResultSet
variable, it takes a long time to print the result out. My code looks
like something similar to this:

ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
System.out.println(rs.getString(1));
}

And this would take nearly one minute to print the resultset out.

Is there anyway that I can make it faster?

Thanks!
Ting

.