Java – where the result set is stored when using JDBC and Oracle drivers

Once I use JDBC with the Oracle driver and run the select query, do I store the query results in Oracle memory or file system or in the server of temporary tables?

Once I run the next method, by getting the next line is loaded from Oracle server memory into JVM memory?

If I define the fetch size on the result set as 1000, which means that 1000 rows are loaded from Oracle into the jdbc driver on the JVM?

resolvent

Solution

The default number of rows (not the entire result set) will be obtained in local memory Once you reach the last row of the obtained row (for example, do next () and try to access the next row), and if there are more rows in the result, another round-trip call will be made to the database to obtain the next batch row

Edit 1:

You can view the number of rows extracted at one time in the result set by performing this operation (please verify the syntax):

rs.beforeFirst(); // will put cursor before the first row
rs.last(); // will put cursor after the last line
int noOfRows = rs.getRow(); // will give you the current row number

Edit 2:

If you want to get more rows in local memory than usual, consider using cachedrowset Even so, round trips can be made, but they are usually lower than the normal result set However, you should consider performing some performance checks on your application

The above is the full content of the location of Java - storing result sets when using JDBC and Oracle drivers collected by programming house for you. I hope this article can help you solve the program development problems encountered by Java - storing result sets when using JDBC and Oracle drivers.

If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>