Let’s say we got this class: Is it somehow possible to take the output of the getValue() method and increment it, or do any math with it, but by using the reference operator and not a lambda? What I am looking to achieve is something like this, but with reference operators: If I write something like thi…
Tag: java
Result set is empty but query works in Postgres
I’m trying to get some results from Postgres into my Java application. As of now, I always used PreparedStatements with ResultSets to get data from my database in memory. But today my code refuses to work, although I use the same code as usual. Here is my piece of code: Here is the log: The ArrayList ex…
Set alignment for all columns in custom AbstractTableModel
I have a custom AbstractTableModel and I would like to center all the columns by default. I know this is made using TableCellRenderer but I don’t know how to implement it in my code. Here’s my class. Is this possible / a good idea or should I stick to doing it in the class where I use the JTables …
Gluonfx build using docker fails, with error: Cannot run program “ie4uinit”: CreateProcess error=2, The system cannot find the file specified
I’m building a native image using the Gluonfx plugin. I’m doing this procedure inside a docker container. The image builds the 7 steps, but doing the link throws an error complaining about missing ie4uinit.exe. These are the error logs: I would like to know if it’s possible to add this depen…
ajax search and scraping prices of bus page // maybe selenium?
I am trying to get prices of routes on a bus page import requests from bs4 import BeautifulSoup import re this is the link https://new.turbus.cl/turbuscl/inicio-compra So right now I am able to find the input boxes of the search, but not sure were to run it. I am getting this error ValueError: too many values…
java.lang.RuntimeException: not supported: class org.spockframework.gentyref.CaptureTypeImpl
Spock is being used to execute an integration test in a Spring Boot project (2.1.18.RELEASE). When I run with 1.3-groovy-2.5, I get this error: If I update Spock to a more recent version (eg. 2.1-groovy-2.5) I get this error: I am using Java 11 and Maven 3.6.3. My pom.xml is rather long, so I’ve reduced…
How to see restored value from savepoints?
I have tried to log info about states that recovered when I start a Flink app using savepoints. I see that the app was started using a savepoint correctly. But I can’t log state values that were recovered. The app calculates how many products were bought. Can I use CheckpointedFunction in such way? I se…
Is there an elegant way to exit ClientRequestFilter?
I implemented a ClientRequestFilter. But one call of a client should not be filtered, which means if the request comes from this class (in my case the class is called TokenClient) the method should just return. Right now as you can see I check the path and if it contains /token it will return. But I would rat…
Adding values to Map from a File
I want to iterate through a file that has key/value pairs and put them into a Map. The file contains values like so: Here is my code: The problem I am having is that the Map called instructions is not adding new values from the file, it stops at size 3, not sure why. Would appreciate some help here. Thanks!
Hibernate: mapping with a map and getting argument type mismatch
I’ve got this class DepartmentPerson in Java where I’ve mapped a Map in Hibernate as following: and in the class I have acceptByPeriod defined as following: Whenever I run a query on DepartmentPerson, I get the message: “java.lang.IllegalArgumentException: argument type mismatch”. This…