There is about 50 chance the request hangs during more than 1 minute. However, RowMapper as used by Spring works by reading each row into memory, getting the RowMapper to translate it into an object, and storing each row's object in one big list. For this reason, you should always use updates. The Oracle JDBC driver has proper support for the setFetchSize () method on, which allows you to control how many rows the driver will fetch in one go. But, the update method can provide how many rows it inserted or updated. When I execute it in my Java Application using Spring JDBC, it takes sometimes less than 1 sec as well but sometimes it takes much more (> 1 minute). Spring JDBC provides two template methods for data insertion. Let's create a PostRepository to retrieve and save post records in the MySQL database: package com. It returns about 15000 lines in less than 1 sec on PGAdmin. 4.0.0 spring-boot-starter-parent 3.0.0 springboot-blog-rest-api 0.0.1-SNAPSHOT springboot-blog-rest-api Spring boot blog application rest api 's 17 spring-boot-starter-data-jpa spring-boot-starter-web spring-boot-devtools runtime true com.mysql mysql-connector-j runtime org.projectlombok lombok true spring-boot-starter-test test spring-boot-maven-plugin org.projectlombok lombok
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |