I have already read
http://stackoverflow.com/questions/321787/using-java-to-encrypt-integers
http://www.exampledepot.com/egs/javax.crypto/PassKey.html
All I need is a simple Encrypter which transforms a 12 digit number to a 12 digit number with the following constraints
The encryption must depend on a password (which will be constan...
Hello,
does anybody know how to put a constant value into an attribute with dozer? I haven't seen anything about that in the dozer's documentation
...
We create a Set as
Set myset = new HashSet()
How do we create a List in Java?
...
I have an application that displays a ScrolledComposite. Users are complaining that the horizontal scrolling increment is too fine, i.e. each click on the horizontal scroll arrow currently moves the bar one pixel at a time. They want individual clicks to cause greater horizontal movement. Could someone explain how I could implement th...
Hello,
This is a pretty simple request, but I just didn't find a way to do it.
I'm basically trying to set up a role in JAXB which says that whenever an null field is encountered, instead of ignoring it in the output, set it to an empty value. So for the class :
@XMLRootElement
Class Foo {
Integer num;
Date date;
….
}
When thi...
The question below is from Java SCJP5 book by Kathy Sierra and Bert Bates.
Given a method declared as:
public static <E extends Number> List<E> process(List<E> nums)
A programmer wants to use the method like this:
// INSERT DECLARATIONS HERE
output = process(input);
Which pair of declarations could be placed at // INSERT DECLARATI...
I've got a pair of Hibernate entities, A and B, that are related via a bidirectional many-to-many relationship, as described here - ie, each entity has a bag referencing a collection of the other type of entity, with a link table comprising the primary key of each entity.
I am also using Hibernate L2 caching to cache the collection valu...
Calling All DWR Gurus!
I am currently using reverse Ajax to add data to a table in a web page dynamically.
When I run the following method:
public static void addRows(String tableBdId, String[][] data) {
Util dwrUtil = new Util(getSessionForPage()); // Get all page sessions
dwrUtil.addRows(tableBdId, data);
}
The new row gets crea...
I have a varbinary column we use to store excel files. I need to update this column with the contents of a different xls file that is currently on my filesystem.
Given a java.sql.Connection, how should I update the row?
We are using sql server 2005.
...
I have a .jsp page where I have a GUI table that displays records from an Oracle database. This table allows typical pagination behaviour, such as "FIRST", "NEXT", "PREVIOUS" and "LAST". The records are obtained from a Java ResultSet object that is returned from executing a SQL statement.
This ResultSet might be very big, so my questio...
how to implement such a requirement via regexp?
I have a list of filenames as String's.
LOAD_filesourceA-01012008-00001.dat
LOAD_filesourceB-01012008-00001.dat
LOAD_filesourceB-01012008-00003.dat
LOAD_filesourceA-01012008-00004.dat
LOAD_filesourceA-01012008-000055.dat
LOAD_filesourceB-01012008_000055.dat
...
LOAD_filesourceB-01012008_00...
What is the best way to convert a java.io.File to a byte[]?
...
I need a simple way to implement a Calendar (similar to google calendar) in java. The calendar must display Monday - Sunday at the top and each hour as a row.
Monday | Tuesday | Wednesday
08:00
09:00
10:00
11:00
How would one create a calendar in Swing like that? I'm using Netbeans IDE. Each column should be able to hold some te...
I have a method that returns void in a class that is a dependency of the class I want to test.
This class is huge and I'm only using this single method from it.
I need to replace the implementation of this method for the test as I want it to do something different and I need to be able to access the parameters this method receives.
I c...
A module I'm adding to our large Java application has to converse with another company's SSL-secured website. The problem is that the site uses a self-signed certificate. I have a copy of the certificate to verify that I'm not encountering a man-in-the-middle attack, and I need to incorporate this certificate into our code in such a wa...
I would like to create a new event-dispatch thread in Swing, and I'm having trouble finding any references online for how to do this. I have done this in .NET by creating a new thread and calling Application.run(...). Has anyone done this? Is it possible in Swing?
FYI the reason I am trying to do this is because I am writing an Eclip...
Using JPA query language, how do I determine the size (number of rows) in an entity (table)?
...
I have read for a while that EJBs are not useful or cumbersome. But what other ways implement the business delegate pattern?
How do EJBs differ from the approach the Spring recommends?
Also, how have recent advances with EJBs changed your opinion.
...
I am looking for:
What JMX is.
Where I can find some good JMX
Tutorials.
What JMX can provide to me as a
Java EE programmer.
Anything else I should be aware
of.
...
I'm trying to code an application which runs un different java platforms like J2SE, J2ME, Android, etc. I already know that I'll have to rewrite most of the UI for each platform, but want to reuse the core logic.
Keeping this core portable involves three drawbacks that I know of:
Keeping to the old Java 1.4 syntax, not using any of th...