Questions tagged [spring-jdbc]

Spring JDBC is a part of Data access layer provided by Spring. The Spring Framework takes care of all the low-level details that can make JDBC such a tedious API to develop with such as database connections, creating prepare statements, process exceptions etc.,

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

Change postgresql row field at start and end transaction

My stack is postgresql and Spring jdbc and I have table with columns like this: |Id| work_data |work_status| |1 |{"somevalue":"value"}| NEW | Question: What is ...
java_user's user avatar
  • 929
0 votes
0 answers
31 views

getting issue unable to load cache item while upgrading java 8 to java17 with spring boot 3.2.1

I am upgrading from java 8 to spring boot 3.1.2, java 17. I am able to build the application, but run time getting this error. what are the clues. Exception in thread "main" java.lang....
rao's user avatar
  • 1
0 votes
0 answers
32 views

Does Select For update query in Db2 need Spring's @Transactional annotation

Is Spring Transaction management needed if the SQL query running on Db2 database itself has the isolation level and locks specified. For example, I have the following java method which has two SQL ...
Arunabh's user avatar
  • 167
-1 votes
0 answers
37 views

JDBCTemplate batchUpdate() is too slow to insert the 60k records in postgres DB

I have around 60k records which I want to insert into my Postgres database. I'm doing a batch update. It is taking more than 30 minutes to insert the records. We are using Hikari for connection ...
Aishu's user avatar
  • 1,308
0 votes
1 answer
47 views

How get connection pool from jdbcTemaplate?

Ok I have ingested jdbcTemplate into some class: @Service public MyService { @Autowired private JdbcTemplate jdbcTemplate; } But how to get connection pool implementation from it? I see ...
Cherry's user avatar
  • 31.7k
0 votes
1 answer
69 views

Spring can't find the Repository bean in the Service

I have a problem when launching the application : Description: Parameter 0 of constructor in com.backend.services.RoleService required a bean of type 'com.backend.repository.RoleRepository' that ...
p1e0's user avatar
  • 13
-1 votes
1 answer
41 views

Field jdbcTemplate in com.lrl.abc.service.abc required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found

I have created spring boot application to create restful Api. I have Postgres db on AWS so i want to connect to it and perform crud operations. I have done following some article but now hitting the ...
Irfan Pathan's user avatar
0 votes
1 answer
102 views

Oracle TemporaryLobs causes Memory Leak

we have a problem with a Spring Boot application (Spring Boot 2.7.x) that uses Oracle 21c as datasource. During the execution, we run in a series of OoM caused by the use of Blob. We have made some ...
Matteo Rossi's user avatar
0 votes
1 answer
53 views

Failed to validate the server name "iapps-in-dev-sql-server.privatelink.database.windows.net" Error retrieving database meta-data;

I am getting the below error after the upgrade. It was working fine in jdk8 and spring boot version 1.5.3-release and MS Sql driver mssql-jdbc-6.1.0.jre7.jar Now I upgraded jdk to 21 and spring-boot ...
Sreejesh's user avatar
-1 votes
1 answer
219 views

Caused by: java.lang.NoSuchFieldException: modifiers

I am working on an existing old spring-boot code while migrating/upgrading to spring-boot 2.7.16 and jdk version upgraded from 8 to 21 I am getting this error import java.lang.reflect.Field; import ...
Sreejesh's user avatar
0 votes
0 answers
11 views

Java DB connectivity via JPA on multiple entity objects

We have a config table which has rows containing queries and a spring boot/java program needs to read the config table and execute the query in each row present in config table and always return a ...
user2949241's user avatar
0 votes
0 answers
21 views

Cursor based ItemReader effect on Spring batch Table

I am allowed to use Select,Update,Insert,Merge,Begin command on PostgreSQL server by db-safer program. Spring boot version : 3.1.2 Spring batch version : 5 When i executed chunk batch using ...
김민석's user avatar
0 votes
1 answer
75 views

I have exception with CrudRepository: DbActionExecutionException: Failed to execute DbAction.UpdateRoot(...))

@SpringBootTest class UserRepositoryTest { private final UserRepository userRepository; @Autowired public UserRepositoryTest(UserRepository userRepository) { this.userRepository = ...
w4t3r's user avatar
  • 5
0 votes
0 answers
21 views

spring-data-jpa 3.1.4 returns List<Object[]> long where as spring-data-jpa 2.6.3 retuns biginteger in this use case

My pojo class is : employee{ long empid; } The table is : employee ( bigint empid) During spring-data-jpa: @Repository public interface EmployeeObjectRepository extends JpaRepository<Employee, ...
velmurugan A's user avatar
0 votes
0 answers
45 views

Vaadin + Spring Boot + JDBC + JDBC Session causing restart loop

I am using Vaadin 24 and have tried the below with Vaadin 23 also. I need to store session data related to user's activity so we tried using Vaadin's Web Storage API and our code look like the ...
Shubham's user avatar
  • 58
0 votes
0 answers
73 views

Using Kotlin's raw strings for sql insert in Spring JDBC namedParameterJdbcTemplate?

Is it possible to use Kotlin's raw strings for sql inserts with the namedParameterJdbcTemplate in Spring JDBC? val insertCommand = """INSERT INTO sqluser.my_table (number_field, ...
Twistleton's user avatar
  • 2,792
0 votes
1 answer
98 views

Oracle incompatible driver ORA-12650

We try to upgrade our web application database from Oracle 12c (12.1.0.2.0) to Oracle 19c (19.0.0.0.0), but I'm encountering the error ORA-12650 with the following stack trace in catalina.log: WARNING:...
Andrei Manolache's user avatar
0 votes
0 answers
35 views

Avoid JDBC spring session | principal name null

found principal name = null. In spring_session table. I am using spring JDBC session for storing session in database. Is there any why to avoid null entries in spring_session?
Sunil Chaphekar's user avatar
0 votes
1 answer
58 views

How to register a GenericConverter to be used by SimpleJdbcCall objects in Spring 3?

Using Spring 3.0.x, I wrote a SimpleJdbcCall defining with returningResultSet() a BeanPropertyRowMapper. Now I want to replace the java.lang.Long type used for object IDs with a strongly typed ID, ...
David Balažic's user avatar
0 votes
1 answer
62 views

Jakarta Persistence - create table

I have this entity: @Entity @Table(name = "t_message", uniqueConstraints = { @UniqueConstraint(columnNames = "key"), @...
Nuñito Calzada's user avatar
0 votes
1 answer
24 views

JdbcPagingItemReader: questions about async/sync behaviour

i have a question about JdbcPagingItemReader: When we initialize the QueryProvider the method setSortKeys is is recommended to be used with an unique key constraint to guarantee that no data is lost ...
thefiery77's user avatar
0 votes
1 answer
41 views

JdbcPagingItemReader: PagingQueryProvider add a parameter value after the second iteration

i created a class that extends JdbcPagingItemReader. Inside i have this configuration. @PostConstruct public void init() throws Exception { setDataSource(dsSrv.getUserDataSource()); ...
thefiery77's user avatar
0 votes
0 answers
9 views

jdbctemplate not acceptin multiple arguments

I am having issue with the query not reading the arguments 'lon' and 'lat'. Is it because it is a nested query? If so then how do I pass the lon and lat to the query? public List<RentalDto> ...
Pasang's user avatar
  • 115
0 votes
1 answer
41 views

PSQL query is working in POSTGRES but gives error in JDBCTemplate

I have my PSQL query running fine in POSTGRES However when I run the same query in JDBCTemplate I get an error. public List<RentalDto> selectRentalsByDistance(Double lon, Double lat) { ...
Pasang's user avatar
  • 115
0 votes
1 answer
32 views

Error when Retrieving a List Result with an Interface Projection

I'm new to Spring Boot and Hibernate, and I need your help. I have two entities, Author and Book (onetoMany) in my Spring Boot application. I'm receiving results that don't match my expectations, and ...
Trung Pham's user avatar
0 votes
1 answer
109 views

Error 404 when post request Spring boot and Flutter app

I try to create a mobile login page using Springboot and Flutter technologies. I am new in development. Tomcat started normally and connected to db. I use emulator pixel 4 api 31 to test my app. Is ...
eleftheria christopoulou's user avatar
0 votes
2 answers
33 views

Pass an array of numbers (TABLE OF NUMBER) Input Param to a Stored Proc call in SpringJDBC

In SpringJDBC I need to call a SP whose parameter is a TABLE OF NUMBER type, i.e. an array of numbers. PROCEDURE MY_SP( PARAM1 IN TABLE OF NUMBER, ...
gene b.'s user avatar
  • 10.9k
0 votes
1 answer
24 views

How can we cascade an exception when methods are annotated with @Transaction in Spring Boot?

Looking at the example below: We have the UserSerice class that has a method invoice() which calls another method createPdf in the InvoiceService. I'd like to handle the ...
Benjamin E.Ndugga's user avatar
1 vote
0 answers
27 views

Why spring-jdbc use "set autocommit = 0;" to start a transaction instead of "start transaction"

I found the database of service has lots of "set autocommit =0/1" statement; I do a little research and found that its from spring-jdbc. It's about the function Transaction; In ...
Woo's user avatar
  • 11
0 votes
0 answers
31 views

Connection pool locked using Spring Dbcp2 pool

I have and application that manages hundreds of databases and I use a connection pool for every database. Sometimes one of the databases becomes locked and all the operations that involves queries on ...
Plebios plebios's user avatar
0 votes
1 answer
98 views

SQL Error: 1406, SQLState: 22001 with SpringBoot + mySQL

I have a String that is 2269 characters long., here the POJO @Entity @Table(name = "t_tropical_es", uniqueConstraints = @UniqueConstraint(columnNames = { &...
Nuñito Calzada's user avatar
1 vote
3 answers
87 views

Display timestamptz in a user's timezone

I'm working on a Spring Boot application which queries a PostgreSQL database. I have a timestamptz column. The end users of my application would like to view these timestamps in their own timezone, ...
Jake's user avatar
  • 425
1 vote
1 answer
55 views

How to use the bean created in the test to run an application?

I am writing test for an application where DataSource is created as a Bean when connecting to the DB2 Database. For the test I would like to use an in-memory H2 Database and call the main method to ...
Jeet's user avatar
  • 365
1 vote
3 answers
206 views

What happens if the response to the commit from the database is not received?

If I have method with @Transaction(with default isolation level) and after all it send commit to DB, DB set transaction's visible for other and send response back to me, but network is lagging and I ...
hololensen's user avatar
1 vote
2 answers
86 views

Spring Boot: database initialization fails with "Referential integrity constraint violation" on init SQL scripts

I'm trying to refine the "TacoOrder" application from "Spring in Action" a bit and am setting up database initialization for a H2 database from my Spring Boot application. This is ...
David Tonhofer's user avatar
0 votes
1 answer
144 views

Constraint "PRIMARY KEY | UNIQUE (ID)" not found; in SQL statement using the Spring Tool Suite 4 IDE

This is the actual error Failed to execute SQL script statement #6 of URL [file:/C:/Users/DELL/IdeaProjects/taco-cloud-1/bin/main/schema.sql]: alter table Ingredient_Ref add foreign key (ingredient) ...
Pascal Torti's user avatar
0 votes
0 answers
87 views

Failed to configure a DataSource: no embedded datasource could be configured. SpringBoot parent 3.1.2

I got this problem when debugging. 2023-07-24T11:39:01.002+07:00 INFO 18324 --- [ main] i.securecapita.SecurecapitaApplication : Starting SecurecapitaApplication using Java 17.0.7 with ...
Vân Bùi's user avatar
0 votes
0 answers
26 views

How to save input given in following json format to database in spring boot

I'm creating an example student registration system and I want to input data in the following format through postman. { "schemeName":"Scheme one", "type":"...
kaW's user avatar
  • 11
0 votes
0 answers
13 views

Spring transaction management using JdbcTemplate and AmazonS3

In a spring boot project I have created a service that is called UpdateClientImage, this service contains an update(String clientId, String imageUrl) method, inside of this method are being called ...
user3419082's user avatar
0 votes
0 answers
43 views

Not adding spring-jdbc maven dependency. The error message did not mention spring-jdbc, which made it difficult to find the problem

I encountered a tricky issue: I intentionally commented out the maven dependency 'spring-jdbc' in a working Spring test project. In theory, it should directly throw something like 'java.lang....
Honphie.Won's user avatar
0 votes
0 answers
197 views

SSH Connection Issue in Spring Boot Application

I have a remote database currently hosted on namecheap via premium208.web-hosting.com using the cpanel which only allows SSH connections to the database that i want to use in my spring boot ...
J Maine's user avatar
  • 23
0 votes
0 answers
127 views

spring boot `jdbcTemplate.query` RowMapper generic issue

I have stuck in RowMapper, the code is showing Generic type error. @Override public List<Person> selectAllPerson() { final String sql = "SELECT id, name FROM person"; ...
Girish's user avatar
  • 11.9k
0 votes
1 answer
121 views

How to represent a bytes array with DB Rider in YAML configuration

I have a series of test cases using Spring Jdbc, Database Rider, and H2 — with Java 17.x. Everything works fine, but I can't find a way to represent a byte array in the YAML configuration file :/ This ...
x80486's user avatar
  • 6,765
0 votes
1 answer
98 views

RequestBody doesn't get body JSON and jdbc.BadSqlGrammarException

I'm trying to make a fast CRUD app usins java spring boot with jdbc as database, I'm having some troubles with adding something new to the database (DisputeLog in this case), at first I'm having an ...
Pao Beltran's user avatar
0 votes
1 answer
33 views

Why am I getting Forbidden 403 while trying to authenticate?

I am trying to authenticate user but I am getting forbidden response. CustomUserDetailService.java public class CustomUserDetails implements UserDetails { private String id; private String username; ...
David Jung Basnet's user avatar
0 votes
0 answers
73 views

How to JOIN tables in Spring JDBC?

I am creating a custom query in Spring using JDBC to join the tables that are in my Database, but when I check the endpoint in PostMan only the results one table appear. Any insight would be helpful. ...
biko's user avatar
  • 13
0 votes
1 answer
260 views

Flyway fails on migrate with schema not found - Spring boot

I have below flyway configuration set in my application-test.yml spring: flyway: enabled: true create-schemas: true default-schema: testit driver-class-name: org.postgresql.Driver ...
Sooraj V's user avatar
0 votes
1 answer
438 views

Spring Boot app terminates with JdbcSqlSyntaxErrorException

This is the application class: package ronit.LearnJPAandHibernatewithSpringBoot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;...
Ronit Pandey's user avatar
0 votes
0 answers
224 views

How does JDBC4 connection.isValid happen in PgConnection?

I have a spring boot application which uses spring actuator to do healthcheck, This does a healthcheck on db as well in my case it is postgres. Every once in a while i get this error in healthcheck {&...
mukulsharma9118's user avatar

1
2 3 4 5
49