Skip to content
Prev 309597 / 398506 Next

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

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: