Spring JDBC Stored Procedure call timing out - spring

I am using Spring SimpleJBDCTemplate for a DB2 stored procedure call, the stored procedure returns around 200k records and it's kind of timing out from my java code.
I tried setMaxRecords option, it helps to an extent.
Is there something like a batch read or a page read that are part of Spring?

Spring has a library that is called Spring Batch. You should definitley see documentation and try to adapt it to your problem.
Please refer to this: Spring-Batch

Related

Calling Oracle Stored Procedure from R2DBC

I am trying to call an Oracle stored procedure from Spring Data R2DBC. I have currently set up querying either by annotation or R2DBC entity template and those work fine. However, I have not been able to call a proc with input/output parameters.
I saw some documentation mentioning support for procedure calls in R2DBC but have not found any concrete examples on how it is done. Any help or link to documentation or examples would be greatly appreciated.
The documentation for how to do procedural-calls can be found in the readme on github for the oracle-r2dbc driver:
procedural calls

How to create a stored procedure, with Spring JPA but without using Entities

In a project that I am working with Spring and JPA, I need to call a stored procedure but it does not have any table stored on the application side, only an input parameter is sent and returns an output parameter to know if I finish the process.
In all examples with JPA it always relates to JPA entities and the BD Tables.
Thank you for your contributions.
Take JPA out the pricture then. Assuming your application has a Datasource configured then inject that to the relevant code and get a connection:
https://docs.oracle.com/javase/7/docs/api/javax/sql/DataSource.html#getConnection()
Then just use standard JDBC.
https://docs.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html

How to read and write data from multiple databases by using spring batch update?

I am working on spring batchupdate ,I search on google I didn't find any solution for my problem.
I have two databases(MySQL,ORALCE) I want to read data from mysql and write into oracle by using batch update .
Your problem is unclear.
You can first read the data from MySQL with one Spring JdbcTemplate object initialized with MySql data source, and then use another JdbcTemplate object, initialized with Oracle data source, to write the data.
If you want to do it in one transaction, you will have to use distributed transactions/XA libraries, such as Atomicos, and Spring distributed transaction manager. See here https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-jta.html for details on Spring integration with distributed transactions libraries.

Is there a way to spring batch read the field set configuration from database?

We are trying to develop a framework on top of spring batch, basically it has to read the data from database like fields, fields order, file location..etc..
Is there any existing frameworks to achieve this, otherwise please shed some light on this...
Thanks,
MK
I don't think there is any such extension available over the framework. You might have to write your own customizations to achieve a database driven configuration for Spring Batch.
What do you want Spring Batch to read in? Have you looked at ItemReaders? http://docs.spring.io/spring-batch/trunk/reference/html/readersAndWriters.html
In your ItemReader constructor you can read in whatever configuration you require.
And see:
Reading Records From a Database in Spring Batch

Ibatis Spring Stored Procedure with Multiple OUT

Is it possible to implement a stored procedure call in oracle, which has more than 3 output (OUT)
using Ibatis 2.3.4 integrated with Spring version 2.7,
If possible please provide link for reference,
Thanks in Advance
I implemented oracle store procedure called using iBatis on Spring, and can't find the limitation about 3 OUT parameter as you described above. In my opinion, it's possible to create store procedure for your purpose, use this link as reference:
Ibatis and Oracle Procedure
If you got any problem, please let me know.
HTH.

Resources