Is there some hack to create a wrapper for java.sql.Connection which works with JDBC 3 and 4 (Sun added a couple of methods and new types to the interface for JDBC 4) without resorting to something which patches the source at compile time?
My use case is that I need to generate a library which works with Java 5 and 6 and I'd really like...
I have identical objects in both a c# server app and a java client app. The server XML serializes these objects and makes them available through a REST service. The java app downloads the data in XML format. What is the best way to deserialize the xml data to my java objects? I am currently using Java org.w3c.dom classes to parse the ...
I have two regular expressions that I use to validate Colorado driver's license formats.
[0-9]{2}[-][0-9]{3}[-][0-9]{4}
and
[0-9]{9}
We have to allow for only 9 digits but the user is free to enter it in as 123456789 or 12-345-6789.
Is there a way I can combine these into one? Like a regex conditional statement of sorts? Right n...
I have an array of java objects.
Each object stores two longs that define a number range.
I already have a guarantee that for all the objects in the range, the number ranges don't overlap.
I want a quick of finding a particular object in the array, given a number which may (or may not) fall within one of the number ranges defined by...
immutability, any good sources on writing immutable programs in a functional way with java?
shifting over to erlang - scala - clojure is not a possibility.
...
We are looking to host a Java Domain Model (written using DDD) inside a web application. Ideally I would like to support RESTful resources and requests, having a single site to support both users and a REST api.
Ideally the same url could be used for both end users and the RESTful API of a given feature (with HTTP content types / negoti...
I have an FTP client class which returns InputStream pointing the file. I would like to read the file row by row with BufferedReader. The issue is, that the client returns the file in binary mode, and the file has ISO-8859-15 encoding.
...
What is the analog in Scala of doing this in Java:
public class Outer {
private Inner inner;
public static class Inner {
}
public Inner getInner() { return inner; }
}
I specifically want my inner class to not have to have a fully qualified name - i.e. I want Trade.Type, not TradeType. So in Scala I imagined it might be somet...
Hi all,
I know that this is a very helping community.. so i hope I will get an answer for my problemt. Actually, I have a swing app which contacts an oracle database via JDBC.
Now I want to deploy this via WebStart. I have a text area in the application that prints out the log messages .
all goes well, jnlp downloads my application ...
If I have an action where the result is a redirectAction to another action in a different class, is it possible to get validation errors to display in the resulting action? E.g. in the following example, if a user executes actionA (which has no views associated with it), and there are errors, is there any way to display those errors in t...
I have a map like this:
private Map<String, List<List<String>>> someMap;
private List<List<String>> someList1;
private List<String> someList2;
....Some initialization.....
....Some list population....
Then I have,
if(someMap.get(someKey) == null){
someList1.add(someList2);
someMap.put(someKey, someList1);
} else {
som...
SuiteClasses will work just fine with a list of classes like {Test1.class,Test2.class}, but when I try to generate a static list of classes, it says incompatible types: required java.lang.Class<?> but found java.lang.Class<?> []
What am I missing?
@RunWith(Suite.class)
@Suite.SuiteClasses(TestSuite.classes)
public class TestSuite {
...
Hi,
I writing a dynamic HTML parsers functionality.
I will want to modify existing parsers and also would want to add more parsers (I expect parsers will be modified as sites a remodified and new parsers will be needed for new sites).
I started writing a generic functionality which use a XML with conditions and rules for each site but ...
Apple seems to have quart rendering on by default:
http://lists.apple.com/archives/Java-dev/2007/Jun/msg00066.html
However there are cases where this is attrociously slow. From a desktop app, I merely add:
-Dapple.awt.graphics.UseQuartz=false
This fixes the slow rendering. But there's isn't a place in the Java preferences panel to se...
I have one security context definition that uses PreAuthenticatedProcessingFilterEntryPoint for the flex part of my application. How can I have another definition that will use standard form login with html forms for another part of my application? Here's what I currently have:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xml...
I have a hibernate mapping which looks like this:
<hibernate-mapping>
<class name="MutableEvent" table="events"
mutable="true" dynamic-insert="true" dynamic-update="true">
<id name="id">
<generator class="assigned" />
</id>
<property name="sourceTimestamp" />
<property name="entry...
Disclaimer: I already asked this question, but without the
deployment requirement. I got an
answer that got 3 upvotes, and when I
edited the question to include the deployment requirement the answer then
became irrelevant. The reason I'm
resubmitting is because SO considers
the original question 'answered', even
though I...
We have tables with legacy columns where SpecialStrings are stored. These SpecialStrings can't be NULL and they instead equal to some SPECIAL_UNICODE_NULL.
So to send an entity back to a client via JAX-WS we have to either implement the whole Entity wrapper for sending it instead of Entity or to add convert logic explicitly to Entity ge...
How can I create a new Exception different from the pre-made types?
public class **InvalidBankFeeAmountException** extends Exception{
public InvalidBankFeeAmountException(String message){
super(message);
}
}
It will show the warning for the InvalidBankFeeAmountException which is written in the first comment.
...
I'm using SWT in Java and I'm trying to left align an image and text that I have inside an SWT Button. It seems like it should be a simple button.setAlignment(SWT.LEFT) call, but that isn't working. A quick Google search leads me to believe this may be a bug in the SWT framework. Does anyone have any help on this?
...