spring-jdbc Questions

4

I am very new in Spring world. I was using application.properties to set different port values. How can I comment some code in application.properties file?
Epigastrium asked 2/5, 2020 at 17:42

4

Solved

I've got a MySQL table with Foos. Each Foo has a numeric non-unique code and a name. Now I need to find if any Foo with one of certain codes happens to have a name that starts with a given string. ...
Ns asked 19/6, 2012 at 15:2

6

I have a class that looks like this: public class MyClass { private final SimpleJdbcCall simpleJdbcCall; public MyClass(final DataSource dataSource) { this(new JdbcTemplate(dataSource)); } ...
Stopgap asked 19/10, 2015 at 22:44

9

I wonder if any one could help me with this. I encountered an issue when I tried writing code with Spring JDBC. When I ran the server, I got the message like I mentioned in the title. I have google...
Hedvah asked 28/7, 2013 at 11:46

4

Solved

Firstly, I can't use the declarative @Transactional approach as the application has multiple JDBC data-sources, I don't want to bore with the details, but suffice it to say the DAO method is passed...
Salesgirl asked 27/7, 2012 at 5:1

4

I am working on spring boot on both command line runner and web application. Both applications require to be implemented with oracle wallet, so I implemented the oracle wallet. The command line run...
Albacore asked 16/5, 2017 at 5:43

2

I'm using Spring with Java. I need to return a Stream of objects from the database query (I use ObjectMapper to map them to JSON). The query results can be quite large (over 500k objects) so I don'...
Ligon asked 8/11, 2020 at 14:43

2

Solved

On Using Spring JDBC which works very well and has some improvements over JPA when using Batch processing. I would love to learn why to use Spring Data JDBC when you already have Spring JDBC. I wou...
Mottle asked 21/8, 2021 at 14:40

4

Solved

JdbcTemplate.update() returns number of rows affected - so you not only know that delete/update was sucessfull, you also know how many rows were deleted/updated. What will be the return value if I...
Shelby asked 16/1, 2014 at 23:1

2

I have to be able to rename the default Spring Session table and found the following configuration options in the spring session documentation. spring.session.jdbc.schema=classpath:org/springfr...
Ender asked 8/8, 2018 at 16:46

3

Solved

I cannot figure out why I am getting "Invalid column name" here. We have tried a variant of the sql directly in Oracle, and it works fine, but when I try it using jdbcTemplate then something is wr...
Ned asked 23/1, 2017 at 15:50

1

I am having issues saving my entity that has a Instant value using the NamedJdbcTemplate. I receive the exception listed below and I am trying to determine the best way to resolve this. Please advi...
Aeroballistics asked 1/3, 2018 at 17:47

3

Solved

I try to use handle query for updating table in the SQL database. Code: @Autowired private ProducerRepository producerRepository; public void update(Producer producer){ String name = produc...
Solfatara asked 9/7, 2018 at 15:43

2

Solved

I have two related stored procedures that involve user-defined types. The first accepts an object ID and returns the corresponding instance of a user-defined type. The second accepts an instance of...
Offutt asked 6/9, 2017 at 7:42

4

In our Server we are using scheduler to perform a particular tasks. There are already many scheduler running on the server which are working smoothly and Perfrorming DB Operations without any hurdl...
Lorrainelorrayne asked 24/1, 2019 at 11:22

1

I have a Spring Boot application (v2.1.5) that uses JPA (Hibernate) to connect to a Postgres DB. Spring Boot uses HikariCP for connection pooling. In my production environment, I see the following ...

2

Solved

I am using the following Java code to run SQL script: @SpringBootApplication public class Application implements CommandLineRunner { @Autowired DataSource ds; @Value("classpath:test.sql") Res...
Pierce asked 9/9, 2019 at 8:41

0

One simple optimization for SQL is the reuse of prepared statements. You incur the parsing cost once and can then reuse the PreparedStatement object within a loop, just changing the parameters as n...
Torsion asked 29/8, 2020 at 0:35

14

Solved

I am simply trying to see the H2 database content for an embedded H2 database which spring-boot creates when I don't specify anything in my application.properties and start with mvn spring:run. I c...
Rost asked 9/7, 2014 at 13:57

4

Solved

I am trying to find an easy way to deal with Stored Procedures / SQL returning multiple result sets. I have been using the SimpleJdbcOperations#queryForList() method however this will only return t...
Ardor asked 22/4, 2013 at 14:30

1

Solved

I am starting to develop with springboot and I have been stuck for 2 days. When i launch my app i get this line. 2020-07-08 11:54:46.377 WARN 33224 --- [ task-1] o.h.e.j.e.i.JdbcEnvironmentI...
Bledsoe asked 8/7, 2020 at 14:32

2

I have a consumer that can say he doesn't want to process more data. I've looked upon the methods in Spring JdbcTemplate, but I see no way to inform Spring I don't want to process more rows when I...
Leftward asked 27/4, 2018 at 10:9

3

Solved

I have a class that looks like this. I need to populate it from two database tables, which are also shown below. Is there any preferred way to do this? My thought is to have a service class to sel...
Emsmus asked 9/5, 2013 at 12:25

2

Solved

I am developing against a PostgreSQL v12 database. I am using SERIALIZABLE transactions. The general idea is that when PostgreSQL detects a serialization anomaly, one should retry the complete tran...
Aglaia asked 23/11, 2019 at 10:4

2

Solved

I'm using Jdbctemplate and I need the inserted id of a query. I read that I have to build a particular PreparedStatement and use GeneratedKeyHolder object. The problem is that in my application al...
Hardan asked 29/1, 2016 at 16:5

© 2022 - 2024 — McMap. All rights reserved.