Skip to main content

All Questions

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

SQL Syntax Error After Upgrading Spring Boot to 3.3.4 Using Pageable with DB2

I upgraded my Spring Boot project from version 2.7.18 to 3.3.4. After the upgrade, I started encountering SQL syntax errors when using pagination (Pageable) with DB2 9.5. The issue only occurs when I ...
Melih Yelman's user avatar
0 votes
0 answers
215 views

How to properly setup a DataSource in IntelliJ for DB2 stored procedures usage?

I have a problem with IntelliJ integration with DB2. We have a Spring Boot application that uses MyBatis mappers to call procedures. It doesn't have any specific configuration, just plain URL + ...
Yevhenii Smyrnov's user avatar
0 votes
1 answer
75 views

In Spring JPARepository, how do I select distinct column values rather than distinct entities?

I'm using Spring Boot 2.5 and JPA 2.1. I have the following entity, mapped to a DB2 table @Entity @Table(name="XYZVVV00") public class MyProduct { ... @Column(nullable=false) ...
Dave's user avatar
  • 18.8k
0 votes
1 answer
185 views

Spring Boot Tests with H2 Database causing ClassCastException

I'm getting this ClassCastException during testing one of my services: java.lang.ClassCastException: class java.math.BigInteger cannot be cast to class java.lang.Integer (java.math.BigInteger and java....
Stefan Greil's user avatar
0 votes
1 answer
346 views

How to write a Criteria Query where the table schema is an input parameter and it avoids SQL injection

I have been attempting to find a way to write the following query to avoid any sort of SQL injection but have continually come up empty handed. "SELECT NEXTVAL FOR " + schema + "....
scottyboombox's user avatar
0 votes
2 answers
165 views

Hibernate show_sql not showing actual query sent to db

It seems what's logged by show_sql is not what's actually sent to the data base (in this case, it's a DB2 instance). This is logged by the application: Hibernate: insert into table ...
ekalin's user avatar
  • 967
0 votes
1 answer
63 views

Is it possible to include COUNT into multiselect using TypedQuery in java 7?

SQL (that works in database): SELECT ffm.REPORTING_PERIOD, count(DISTINCT ffm.FI_MESSAGE_ID), count(ffa.FI_ACCOUNT_ID) FROM RAZV.FINTAEOI2_FI_MESSAGE ffm JOIN razv.FINTAEOI2_FI_MESSAGE_FI ffmf ON ffm....
wannabebetter's user avatar
0 votes
0 answers
493 views

Unable to fetch records when offset is >= 1 (Spring JPA -> IBM DB2)

I'm a newbie and trying to fetch records in a Springboot application from DB2 database with paging concept. The service call works great when I set offset=0 and size = 'n' But when I set the offset to ...
Rakshith Rahul B's user avatar
0 votes
1 answer
2k views

How to find the jdbc driver version of DB2 in our project? [duplicate]

I can only find the version of db2jcc4 in pom.xml, which is 10.1. How can I know the version of JDBC driver that the db2jcc4 is using? BTW, I did not install db2 in my computer. It's a remote database....
Pip's user avatar
  • 17
0 votes
1 answer
612 views

There is other option to connect spring boot to db2?

I'm working with Spring boot, and I need to use a db2 database connection, currently is configured to work with maven and properties, but first I need to create the jks file, and testing part doesn't ...
LuisEduardoLD's user avatar
0 votes
1 answer
2k views

How can I create a db2 connection in Spring boot without use application.properties?

I need to build a connection to db2 database, but I can not use application.properties at this moment, so how can I create this connection?
LuisEduardoLD's user avatar
0 votes
0 answers
186 views

Set JDBC cursor type with Spring

We have developed a Spring Boot Java application which access a DB2 database. Now the system has been live for some time, we see the DB2 database crash every few weeks, which has caused us to review ...
Steve's user avatar
  • 13
0 votes
1 answer
264 views

Hibernate GeneratedValue does not works properly

Good night, I'm trying to use the increment implementation through Hibernate's IncrementGenerator strategy. However, in the query it does not add the SCHEMA in SQL: select max(nr_prop) from prop_tran ...
Joan Oliveira's user avatar
0 votes
0 answers
600 views

Getting exception with Spring+JPA+DB2 database - org.hibernate.exception.SQLGrammarException

I am getting below exception and application get stuck with this error. If I restart the application (server) then it works fine. I see this error intermittent after 3 or 4 days of interval or ...
Hanamant Jadhav's user avatar
0 votes
2 answers
361 views

JPA/Hibernate rolling back list of children is not working

I'm using a DB2 Database and JPA/Hibernate with Java Springboot, but rolling back a transaction when using JPA's .save() method is not working. My main entity is not saved because it is used/blocked ...
J-Eibe's user avatar
  • 182
0 votes
1 answer
1k views

Could not load requested class : org.hibernate.dialect.DB2 at JBOSS deployment time

I am trying to migrate the versions of spring framework as well as that of hibernate. For spring framework I moved the version from 3.2.18 to 4.3.20. After that I have upgraded hibernate version from ...
Ritesh_RM's user avatar
1 vote
0 answers
96 views

Spring JPA- DB2 ZOS - Observing -104 error during shut down of DB2 LPAR

We are seeing the db2 -104 issue during db2 lpar graceful down testing, And it looks to be "SELECT 1" query is being executed during the lpar testing and this is only observed in DB2 log. ...
user15012396's user avatar
0 votes
0 answers
245 views

MyBatis foreach typeException

Not very sure as to the syntax of the foreach condition. Since an array is used, collection should be my key and item should be my value. However it says #2 is null. May I ask why? I have an array of ...
user14949876's user avatar
1 vote
0 answers
2k views

Connection to IBM DB2 in AS400 using JT400 throws Connection was dropped unexpectedly

I'm trying to connect to an IBM DB2 in AS400 using JT400 driver but it thows Connection was dropped unexpectedly exception. My application.properties : I even tryed it with the hardcode way : I ...
Alae Essaki's user avatar
0 votes
1 answer
1k views

IBM Data Server licence for JDBC and SQLJ is invalid

Im trying to connect to an IBM DB2 in AS400 using jdbc and ibm DB2 jcc driver. credentials are valid. the problem is, when i try to connect to the client db2, it tells me that my db2 connect licence ...
Alae Essaki's user avatar
0 votes
0 answers
524 views

DB2 Java Spring @Transactional with Propagation.REQUIRES_NEW not reading Isolation.READ_UNCOMMITTED

I have a weird problem I can't figure out. DB2 database Java Spring 4 Hibernate 4 I have one transactional class: public class B2BTrackingMsgProcessorImpl … { private GenericProcessor trackProcessor;...
justanu's user avatar
  • 81
-1 votes
1 answer
79 views

Are these SQL queries equivalent? And which is better or is there a better option?

I am working on a Spring web application that utilizes hibernate to connect to a DB2 database. I am try to optimize a service method that gets called may times during a wed service call by reducing ...
Peter O.'s user avatar
0 votes
1 answer
1k views

How does Hibernate control the transaction with multiple session.update()s if you don't commit the transaction explicitly?

I have inherited a system that uses Spring MVC and Hibernate that stores into a DB2 database. Recently it started having what looks like a deadlock problem reported by DB2 so I've been working on ...
toronaga07's user avatar
0 votes
1 answer
2k views

Spring data jpa calling stored procedure with lots of parameters

Is it possible to map an object to all the parameters inside a NamedStoredProcedureQuery? I need to call a stored procedure that has over 40 parameters that it takes in. The following code becomes ...
syy's user avatar
  • 797
0 votes
1 answer
2k views

Spring @Transactional timeout does not work as expected with DB2

We have a spring application which integrates with a DB2 (LUW) database. In a specific flow we have a method annotated with @Transactional(timeout=60) On database heavy load we have observed that ...
nik686's user avatar
  • 705
0 votes
2 answers
5k views

com.ibm.db2.jcc.b.SqlException: [ibm][db2][jcc][10275][10041] Unsupported ccsid, encoding, or locale: "Cp037"

I'm new to WAS server. I'm doing POC with Java 1.8, Spring(4.3.9.RELEASE), Hibernate(4.2.0), DB2 and WAS 8.5.5(installed java 1.8). Server started successfully but getting below exception while ...
sivabalaji's user avatar
0 votes
1 answer
3k views

: Error creating bean with name 'entityManagerFactory' defined in class path resource

i create a spring boot sample from spring.io and i add this dependency : web,jpa,driver db2,but i have this error org.springframework.beans.factory.BeanCreationException: Error creating bean with ...
Maliheh Hosseini's user avatar
2 votes
1 answer
3k views

Exception while connecting spring data config to IBM DB2 z/os

I am getting the following exception while bringing up the spring boot app(app doesnt not have any code just the DB related configs and connection parameters which are defined in the application....
Tarun Shedhani's user avatar
0 votes
1 answer
735 views

Is VARARRAY a data type in DB2?

VARARRAY a data type in DB2? If so how can i invoke a stored procedure with IN parameter as VARARRAY using simpleJdbcCall using Java.
Shandhanu Mohan's user avatar
0 votes
0 answers
203 views

"Unable to set Transaction Id on connection" error - Spring DatasourceTransactionManager

I am in the process of migrating a legacy WebSphere application to Spring boot. This application makes heavy use of database transactions and seemed to work fine until it hits a particular block ...
enorthcutt's user avatar
0 votes
1 answer
305 views

Xquery with JDBC -- Bad SQL grammar

I try to execute a SQL request (that contain a XMLQUERY statement) with JDBCtemplate. But each time I execute the request DB2 send me an error telling me "Bad SQL grammar". And there is not a lot of ...
Corentin Renard's user avatar
0 votes
2 answers
1k views

Using a remote database as spring boot datasource

I'm trying to configure spring boot datasource as a remote IBM DB2 database. I have added the following configurations in my application.properties file: spring.jpa.hibernate.ddl-auto=none spring....
Muizz Mahdy's user avatar
0 votes
1 answer
680 views

Migrating from Weblogic to Spring/HikariCP

My current system is as follows: Weblogic 12c Spring 3.x JSF 1.1 We are looking to migrate from Weblogic to HikariCP as we start our transition to Spring Boot & Angular. Our datasources were ...
lank81's user avatar
  • 49
0 votes
0 answers
403 views

Lock in DB2 with Spring JPA until INSERT

In DB2 (IBM) I have several tables with historicized entries, only the most current row (highest timestamp) with a certain key holds the data that is actually used in other applications. So when a ...
Dora's user avatar
  • 47
0 votes
1 answer
214 views

Spring Boot application, running on WAS 9, eventually fails to connect to DB2 database

We have a spring boot application, deployed to WAS 9. It uses JPA connection. The UI triggers a background process that reads and writes data to one DB2 database using JPA. The application eventually ...
VilleLipponen's user avatar
1 vote
2 answers
9k views

Liquibase: Change column to an autoincrement column (identity) in DB2

I'm trying to change a BIGINT Column to an autoincremented column in DB2 but I can't seem find how. I tried doing it like this: <changeSet id="08.01" author="..."> <addColumn ...
Alex's user avatar
  • 2,146
0 votes
2 answers
3k views

Execute multiple INSERT statement in MyBatis for IBM DB2

I am trying to execute multiple INSERT statement via MyBatis for IBM DB2 using Spring Boot (Java). In XML <insert id="insertIntoTempTmpCopyTo" parameterType="map"> <foreach collection="...
user1993412's user avatar
1 vote
1 answer
7k views

A connection failed but has been re-established. The host name or IP address is "*.*.*.*" and the service name or port number is ***

Getting the error while doing the update query in DB2 batch update. exception : org.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [UPDATE DBO....
Muthuvel K's user avatar
-1 votes
3 answers
473 views

java.lang.NumberFormatException in db2jcc.jar

I am hitting this exception in a Java application. I extract the JAR file and try to check what is the root cause of this, but I fail to get it, because I can't debug on it. I have the source JAR ...
Panadol Chong's user avatar
0 votes
1 answer
342 views

Configuring custom properties in a DB2 autoconfigured datasource

I am relying on Spring Boot to autoconfigure a DB2 data source using the standard configuration properties (spring.datasource.*). The point is I need to set up a custom DB2 configuration property in ...
codependent's user avatar
  • 24.4k
0 votes
0 answers
208 views

Hibernate/JPA Only Displays Select Statements. Update/Delete Statements Are Skipped And There Are No Errors In The Console

We are using Hibernate/JPA and our Delete/Update calls work in the standalone JAR. However, in the WAR, only SELECT statements are shown, and the Delete/Update queries are completely skipped over. ...
OakDawg's user avatar
0 votes
1 answer
964 views

spring boot : how to set db2 encryption password for column value encryption

I want to set db2 encryption password command when spring boot starts a connection with my db2. Basically some of the columns in my table are encrypted. I tried hibernate mapper @ColumnTransformer(...
Monil's user avatar
  • 11
2 votes
1 answer
3k views

Using with UR option of DB2 in Spring Data JPA

I am looking for an example for using DB2 with UR option with JPA Repository of Spring Data JPA. There is already a duplicate question with no answer on it. "DB2 “With UR” Spring Data JPA" How can ...
user1575601's user avatar
0 votes
0 answers
336 views

Spring jdbctemplate working on tomcat but gives error on WAS server

I am trying to connect to db2 using spring jdbc template. Everything is working fine when deployed on tomcat server. But the same application when I am trying to deploy on WAS server is not working ...
zakib's user avatar
  • 11
4 votes
4 answers
7k views

Spring JPA CrudRepository save(Entity) is returning 0 in id field

I am adding spring JPA/Hibernate 5 to an old project. I am running CrudRepository .save(Entity) method against a Mainframe/DB2 table. The row is inserted just fine, but returnedEntity.getIdColumn() ...
Elena's user avatar
  • 61
-1 votes
1 answer
59 views

I want to create element in DB2 from input which we get from XML and JSON by validating it and need to store in DB2?

How can we validate input from XML and JSON, need to create that element in DB2?
XInag's user avatar
  • 1
0 votes
0 answers
1k views

Concurrent open statements and Out of Package Error Occurred in when migrated to jboss eap 6.4 from websphere 7.0

We are facing below issue when migrated existing application from webspere 7 to jboss eap 6.4. Please help me on solving the issue. Existing setup: WAS 7 IBM DB2 database spring 1.2 Migrated setup: ...
Suresh A's user avatar
6 votes
0 answers
2k views

DB2 insert clob [String constant too long]

I'm trying to insert some rows in a DB2 table which has a CLOB column. The limit I found is that I cannot insert a String constant bigger than 32KB and I can't shorten it because it's a JSON String. ...
mmuca's user avatar
  • 61
0 votes
1 answer
426 views

Spring JdbcTemplate: Return value type of count(*) in ResultSet of PreparedStatement

What is the return value type of count(*) in the ResultSet of a Prepared Statement with Spring JdbcTemplate? String query = "select count(*) as ROW_COUNT from table1"; List<Map<...
user3193317's user avatar
0 votes
0 answers
157 views

how to store the data after executing the the query in java

This is my stored procedure call after jdbcCall.execute(in) successfully how will I return the response? Currently, I am getting null as the response. public SPDynamicReportResponseDomain ...
Shashank Ranjan's user avatar