Originally posted by Rene Smith:
The code looks good to me. The only thing you could do is set the obj = null, rs = null, statement = null, and connection = null at the end. I don't thing any of those would cause a memory leak though....
Originally posted by Chantal Ackermann:
I think it should work if you make sure that the url contains an exclamation mark after the jar file:
However, I had the same problem some time ago, and I didn't think of trying to use ! in the path. instead, I am using another method from the class loader:
classLoder.getResourceAsStream([path inside jar]);
as your jar is in the class path, so are your binary files. thus, the class loader can load them directly from the classpath. this works fine for me (I am loading gifs this way).
the path you give to the method is the relative path inside the jar. so a gif that is stored at the first level in the jar would have the path "mygif.gif", some file in the directory "resources" inside the jar would have the path "resources/mygif.gif".
this works for the application even if it is not started through JWS, but from an executable jar, or the classpath is accordingly.
hope this was clear