java - jtds ignores setFetchSize. How can I limit the fetch size? -


i trying limit fetch size of select query. unfortunately jtds ms sql driver still reads rows.

i not want limit or offset select. want save memory such need less ram. not need setmaxrows.

my sample code:

url="jdbc:jtds:sqlserver://myserver:1433;databasename=mydb"; mysql="select * myverylargetable"; con.setautocommit(false); batchsize=1000; s =con.createstatement(resultset.type_forward_only,resultset.concur_read_only); s.setfetchsize(batchsize); rs = s.executequery(mysql); rs.setfetchsize(batchsize); rs.next(); // here rows coming in on network want 'batchsize' 

how can limit fetch size?

the solution insert ;usecursors=true url.

 url="jdbc:jtds:sqlserver://myserver:1433;databasename=mydb;usecursors=true"; 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -