Skip to content

Tag: java

Combine JPA Query annotation with Oracle sample method

i am trying to pass a parameter into a JPA query Example code But i get an error because of the sample(:percentile). If i just hardcode a number in there it works but not with a param. Is there a way to escape the brackets or something similar? Thx Answer The error is on the following part Unfortunately it do…

Java Apache POI Bug

While working with the Apache POI Implementation I ran into a strange behaviour. I cannot explain the cause, so if anybody can give some hints, I would love to hear them. It is not even a big blocker for the problem that I was solving – at this point it is more a curiosity thing. So here it goes: As

Read a socket direclty from InputStream or from BufferedReader?

My goal is to read the n number of bytes from a Socket. Is it better to directly read from the InputStream, or wrap it into a BufferedReader? Throughout the net you find both approaches, but none states which to use when. Answer Since your goal is to “read the n number of bytes” there is little po…

CWE 73 External Control of file name or Path

I am working to fix Veracode vulnerability CWE-73 (https://cwe.mitre.org/data/definitions/73.html) for my application in which the input filename is dynamically sent by our other application it starts with static names like abc, xyz but full file name usually like abc_1234567.txt. Snippet of existing app code…