Skip to content

Java Exception error while reading large data in R from DB using RJDBC.

2 messages · Jessica Streicher

#
I didn't have the same exception yet, but please make sure you have a stable connection (avoid wlan).
I personally ran out of memory very often and had to make several queries, combining the results in R instead.

This is probably not the best thing to do, but worked for me to fetch large amounts of data, though it takes a while:
	
res<-dbSendQuery(conn,query)
result<-list()
i=1
result[[i]]<-fetch(res,n=100000)
while(nrow(chunk <- fetch(res, n = 100000))>0){
	i<-i+1
	result[[i]]<-chunk
}
allResults<-do.call(rbind,result)
On 30.10.2012, at 12:32, aajit75 wrote:

            
#
Actually forget that loop, that was old code. Now remember i had to actually split the one query down into several queries to get everything.
On 01.11.2012, at 18:38, Jessica Streicher wrote: