How to encrypt String in Java

This is the first page that shows up via Google and the security vulnerabilities in all the implementations make me cringe so I’m posting this to add information regarding encryption for others as it has been 7 Years from the original post. I hold a Masters Degree in Computer Engineering and spent a lot of time studying and learning … Read more

How to request.getParameterNames into List of strings?

Just construct a new ArrayList wrapping the keyset of the request parameter map. I only wonder how it’s useful to have it as List<String>. A Set<String> would make much more sense as parameter names are supposed to be unique (a List can contain duplicate elements). A Set<String> is also exactly what the map’s keyset already represents. Or perhaps you don’t need it at all for the particular functional requirement … Read more

DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001

I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine. When trying to connect from a remote server using JDBC I am getting the “Connection refused. ERRORCODE=-4499, SQLSTATE=08001” error. Based on information found here https://www-304.ibm.com/support/docview.wss?uid=swg21403644 I have confirmed that and with these JDBC connection values I have verified that the … Read more

How to create a sub array from another array in Java?

How to create a sub-array from another array? Is there a method that takes the indexes from the first array such as: I don’t want to go over making loops and making my program suffer. I keep getting error: cannot find symbol method copyOfRange(int[],int,int) This is my code:

How can I use ant to execute commands on linux?

I would like to use ant to exectue a command like below: But it replies an error say The ‘ characters around the executable and arguments are not part of the command. The background is: I want to use ant to stop the apache server but it doesn’t installed by the same user I run … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)