Skip to content

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…

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!