I am searching a DB and setting what is found in a resultset variable and I saw it took awhile to run my function and i narrowed it down to the resultset.getstring. I say this because all I did was set it to a variable and it took an average of 24 milliseconds per row to do that. I did do some checking and the string i was getting was about 9000 characters long making it about 70kb if I counted it up right. I put part of the relevant code below.
Is that call typically slow? If so is there something else that can be used that would be faster? Or could it be the size of the string causing the slowness? Sorry if this was answered before but I could not find it.
int itcount = 0;
st = DB_Conn.createStatement();
st.setFetchSize(1500);
st.setQueryTimeout(17);
ResultSet rs = st.executeQuery(query);
StringSearch ss = new StringSearch(look);
String test;
while(rs.next()){
if((itcount % 1000) == 0){
System.out.println(itcount);
}
test = rs.getString(1);
itcount++;
}