Category "java"

Spring Boot/Spring Batch: Using and configuring two DataSource via app properties

I'm working with Spring Boot/Spring Batch, and need to provide two jdbc Data Sources. I can't find a way to automatically load the config parameters from my app

How can i calculate working days off in java

Im trying to calculate the working days off with some required like: In a month will work on 2 Saturdays . If this week work on Saturdays . The next week won't

Error while parsing, when loading the data from snowflake having array datatype

I am trying to read data from snowflake and load it to other storage location. I am using snowflake jdbc driver 3.12.9 to read the data and jackson library(2.10

Reuse a method with nested for-loops that only differs by some lines inside the inner loop

I have a java method that basically looks like this: public static Map<String, List<MyObject>> myMappingMethod(List<A> listOfA, List<B>

ArrayList<Integer> will only keep one set of parameters. the rest is not being updated

I'm confused as to why the variable answer will only output one set of answer. I have a recur function that basically counts from i to size. it will then return

How to reduce the JPackage size?

I am using JPackage to create installer to my javafx application. I am using lot of lib in my project. If I create JPackage the size of installer is 100 MB. How

How to use LocationRequest? Because direct constructor is not working nor .create()

I am trying to get current location in a map fragment but unable to do so because LocationRequest.create() is not wokring. Neither works: LocationRequest l = ne

How use File("/sdcard/myfile") without READ_EXTERNAL_STORAGE on android 11?

After my Application have been refused by the play Store I have to remove MANAGE_EXTERNAL_STORAGE to the manifest. This authorisation is only for app like antiv

How do I use jdk.net.hosts.file and fallback to default NS resolution?

After I added -Djdk.net.hosts.file property my app cannot resolve the name of my local machine. Is there a way to make it fallback to default resolution when no

Neighbours does not yield true

I am writing a small program of how to calculate sum of neighbours of a given position in a grid. for some reason the program does not recognize the right value

how to replace all in a given string except the last 4 digits like **** **** **** 4587 [duplicate]

"\\d(?=\\d{4})","*" I've tried it like that but it does not seem to be working it gives me the exact same string i entered to the scanner

intellij mass refactoring using macros

I am working on a project in intellij using java and spring. I want to change in multiple files my api's in a similar way like this: instead of: public void som

No variants of io.grpc:protoc-gen-grpc-java:1.33.1 match the consumer attributes

Issue: I'm using Dexguard to obfuscate codes for release build. Previously, I could build as normal without errors. However, when I add this dependency com.gith

Hibernate Jpa: update on @Embeddable table generates a query using the wrong table which @Embedded

I have the database tables Person and Details. Details are intended to carry the miscellaneous fields for the Person using the foreign key PERSON_ID. JPA code h

Swagger - How to hide request fiends on API wise, for same input model?

Using Swagger with SpringBoot implementation "org.springframework.boot:spring-boot-starter-web:2.6.7" implementation "org.springdoc:springdoc-openapi-ui:1.6.8"

Serializing multiline string from JsonNode to YAML string adds double quotes and "\n"

I have a YAML string where one of the attributes looks like this: description: | this is my description //imagine there's a space after description th

How to cache token with Microsoft Graph for Java

I am using Microsoft Graph SDK for some requests however everytime I perform a GET request it does another request to get a token. I've tried reading documentat

Chromedriver Selenium getting 'Connection Reset' when versions match

I am using chromedriver but am sometimes getting the following errors: 03:34:09.188 [AsyncHttpClient-1-2] WARN org.openqa.selenium.remote.http.WebSocket - Conne

In Java, how do you deal with double quote inside of a CSV that you need to parse

here is what I want to do, This my spend.csv file : "Date","Description","Detail","Amount" "5/03/21","Cinema","Batman","7.90" "15/02/20","Groceries","Potatoes",

Issue while getting custom message from @email annotation Spring Boot

I'm trying to get the message from my @Email annotation for my front-end . The issue is that it doesn't actually pass and I get an empty response. Nothing gets