Category "java"

How do I call one constructor's variable into another constructor variable?

I saw several posts based on calling variables of one constructor to another. But I am beginner using visual studio to code, we are not using any "main" method.

How do I call one constructor's variable into another constructor variable?

I saw several posts based on calling variables of one constructor to another. But I am beginner using visual studio to code, we are not using any "main" method.

Redundant "Reset stmt" before "Execute" when setting useServerPrepStmts and cachePrepStmts to true in MySQL Connector/J

I'm using MySQL Connector/J (version 8.0.28) as the driver on client side. Following is part of my code for test purpose: PreparedStatement ps = null; String ur

How to iterate through all instances of an entity in Spring data JPA

I have an entity called packet, I want to update an attribute in all instances of that entity. The attribute I want to update is the price of the packet by a gi

Is it reasonable to have properties file while having Javaconfig classes in spring projects?

I encountered handful of guides to creating spring data jpa projects and people configured persistence layer using properties file and javaconfig both. If we on

Is it reasonable to have properties file while having Javaconfig classes in spring projects?

I encountered handful of guides to creating spring data jpa projects and people configured persistence layer using properties file and javaconfig both. If we on

Finding the third largest string from an array of strings in Java

One of my friends asked me about a coding challenge that their lecturer gave them as an exercise. I got a solution working to solve it. But I think the solution

How to get all the dependencies of Maven packages

To start off, I am still a student and trying to learn things, but I am quite stuck on how to get all the dependencies of each package from Maven. Initially, I

Spring cloud stream merge responses from two different functions

I'm trying to use spring cloud stream to solve the following problem: I have a class that calls two separated functions (Function A and B), both of those funct

Investment value calculator

This is supposed to be an investment value calculator using JavaFX, and I got most of the code working. I just can't get it to properly show the future value am

Is Java "pass-by-reference" or "pass-by-value"?

I always thought Java uses pass-by-reference. However, I've seen a blog post that claims that Java uses pass-by-value. I don't think I understand the distinctio

Java Flight Recorder - Async I/O support

Does JFR support Async I/O? I am using Java Flight Recorder (on HotSpot 1.8.0_144) + Mission Control to profile an app. On the File IO tabs of Mission Control,

jsp page shows 404

Got a simple project setup, my goal is to load a jsp file: I got my Controller with a RequestMapping for a jsp file. package com.example.registrationFrom.contro

Sprint boot database polling or listen database updates

I have 2 Spring Boot applications let's say named App1 and App2. There is a table in oracle DB with status column. when App1 runs a scheduler, it will update t

How to implement Iteration over the Nested Nullable Lists using Java 8

How can implement iteration done with multiple loops using Java 8 ? I need to check if one of the nested objects contains the specified String i.e. "BA" or not?

Debugging Github Packages repository connection in Gradle

I have set up a private project in Github that has some Maven packages. I can browse to them on the Github web site. By following the directions here I have set

In eclipse, I select create runnable jar file, but the file generated is normal jar

I have seen tutorials wherein the generated files properties it is meant to say: executable jar file, however, mine solely says .jar file. I use JavaFX and scen

Java stream list to index map

How can I get a map from a list of strings, where the index is the key and the string is the value? If I have such a list List<String> list = List.of("foo

App Engine Datanucleus JPA throwing javax.persistence.PersistenceException on Collection properties of Entities

The error occurs at runtime after the enhancement has been done successfully. I thought it had got to do with entity relationships but further probe showed that

Explore Graph in RDF4J custom function

I'm trying to implement a plugin for Ontotext GraphDB. I hope it will compute the distance between two entities via breath first search (see GraphDB as an undir