<blockquote>
  <p>UPDATED: on win2k it seems it works OK. Sorry for the confusion.</p>
</blockquote>

<p>MS Windows Vista internal ftp client has a strange behavior.
When redirecting its output and error to a file, the errors do not show up there:</p>

<blockquote>
  <p>ftp -n -s:commands.txt host >output.log 2>&amp;1</p>
</blockquote>

<p>When running it from Task Scheduler inside a batch file, I don't get any error messages if connection refused. Even if echo is on or with the -d option.
Do you have a workaround for it?</p>

So you want users to be able to access the database without knowing the credentials? Your only option is server-side database access. Unfortunately there is no way of hiding the username and password in Java -- if you put it into a properties file and encrypt it, a determined attacker could still attach a debugger and see what values are being held in your code.
Also, unless you're connecting to the DB over a secure connection someone could run a packet sniffer such as tcpdump and get the credentials there.
You say that you're running a JBoss server, what might be best is to set up remote EJBs so that your client application doesn't access the database directly - it has to go via your EJB methods. (It doesn't have to be EJB, by the way, you could do something such as web services if you prefer).
The point is, your server talks to the databas directly, and your client's only access is via a limited set of interfaces you define on the server.