In an ejb after I look up a secured javax.sql.DataSource using its global JNDI name e.g. jdbc/MyDS (not resource reference) is there a way to get a connection via getConnection(). This is on WAS 8.5.5 and the data source has both a container managed and component managed authentication alias with “Mappi…
Tag: java
In Android Studio, text does not appear on top of an image
I’m doing a small project on Android Studio, and I’ve put a picture as a dark blue background. I inserted white text on top of this dark blue figure, but the white color in the letters still doesn’t show. The Graphical Interface. See that I put the color white, but it still doesn’t sho…
How can i can get Strings from Enum after using toString()
I am creating a list from which the user can select from using Vaadin8. I want to get the values from the Enum but the string values with spaces not the Element Names. Here is the list created to select from the Enum elements: And here are 3 lines I tried that did not work: Answer You can add a
Mockito testing method void
I have a method called calculate after which the result is printed, whatever, i need to make a test on which i see if the value of condition was changed to “no need” or it remained “first”, how can i check this using mockito testing? I tried so far, but i did not succeed. A good theore…
How to merge two jsonNodes in one
I have two variables of class User as follows: I want to create a JsonNode with the following structure: I have converted the objects to nodes, but I do not know how to merge them using Jackson. Or is there a more efficient way to create one json node structure with the two classes ? I am using Kotlin and
Swap Jackson custom serializer / deserializer during runtime
I have the following system: I am sending MediaType.APPLICATION_JSON_VALUEs from spring controllers to my client and vice versa. I also have an export/import feature of my to-be-serialized classes. The JSON File is created by using an ObjectMapper and utilizing the writeValueAsString and readValue methods. I …
How show or hide images in condition with javafx
I need help to program a windows based application with JavaFX. I simply want to show or hide some images with if/else condition. what I exactly want is something like this: if x=1 then show image1 if x=2 them show image2 I tried setvisible() and setDisable() methodes to do this, but it doesn’t work. an…
spring boot starter validation simply not working
Problem: I need to validate some json inputs and outputs in my Spring API, I’m trying to use spring boot starter validation (Already know that is not into spring-boot-starter-web, so I added it manually) but it never throws the exception when something is bad based on the validations in the DTO class (M…
Rabbit MQ doesn’t flush acks?
The problem appeared in logs: Consumer failed to start in 60000 milliseconds; does the task executor have enough threads to support the container concurrency? We try to open handlers for like 50 queues dynamically by SimpleMessageListenerContainer.addQueueNames(), then application is started. It consumes some…
Does Hibernate allow writing of String/Type Safe SQL?
Does Hibernate allow the writing of String/Type SQL , similar to Entity Framework /w Linq, where a person can write proper Sql, and any misspelled SQL Table, Column names will be shown at compile time instead of run execution time? Answer As requested I’m adding my comment as an answer. Id depends on ho…