I'm seeking an efficient way to display an SQL table queried via Hibernate in a JTable.
Query q = em.createNamedQuery("Files.findAll");
List rl = q.getResultList();
It would probably be preferable to use the List returned by that (In this case, that would make a list of Files objects (where Files is an internal class, not java...
Take a look at setAccessible - a way in Java to let you call private methods by reflections. Why didn't .NET implement such a feature yet?
...
This is my first time working with regular expressions and I've been trying to get a regular expression working that would match the following:
apple
apple inc.
apple co.
apple corp.
but would not match:
inc. apple
co. apple
apple co. inc.
apple corp. inc.
apple inc. corp.
and so on...
This is what I got so far (apple)\s(inc|co...
HashMap<Pair<Class<T>,Boolean>,String> abc = new HashMap<Pair<Class<T>,Boolean>,String>();
What is the best way to represent Pair here... Does Java offer anything?
My key will always be a {class,boolean} pair.
Thanks!
...
Can anyone explain to me what the benefits and and drawbacks of the two different approaches are?
...
If gathering requirements for a medium-to-large web-based project, at what point should one consider using Java-based back-end, JSP, etc, over a scripting language like PHP, Python, or Ruby?
Hearing "use the right tool...", when is Java the right tool for web-based projects?
...
What I want to do:
I want to use the @Configured annotation with Spring. It requires AspectJ to be enabled. I thought that using the AJDT plugin for compile time weaving would solve this problem. Before installing the plug in the dependencies which were supposed to be injected into my @Configured object remained null.
What I have don...
How do you specify the username and password for a JDBC connection when acessing a secure database?
...
I need to add functionality to a website to allow users to record a short sound snippet with their microphone.
I understand that this is possible with flash - but is there a free solution?
Ideally I was hoping this could be achieved without using applets.
Does JavaFX or flex provide this functionality?
Thanks in advance.
...
Say I want to output a huge set of search results, as XML, into a PrintWriter or an OutputStream, using XOM. The resulting XML would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<resultset>
<result>
[child elements and data]
</result>
...
...
[1000s of result elements more]
</resultset>
Because the...
I want to look at the javadoc in html format but do not want it for the entire package, is there some way to do this.
...
HashMap<Pair<Class<T>,Boolean>,String> abc = new HashMap<Pair<Class<T>,Boolean>,String>();
I have two approaches here... create a key{class, Boolean} -> {string} or i could also do this.
{class} -> {Boolean, string}
the first approach has 1 level of indirection which the second approach has 2... what are the pros and cons here? Is th...
I'm trying to think of a regular expression for this but not having any luck..
Let's say you have a security question on you website so the person can recover a password. People often forget exactly how they entered information. For example, given the question "What company do you work for?", a user might answer "Microsoft Corp.". But ...
I am looking at java APIs to convert JPEG file streams to TIFF files. I looked at the JAI but did not find something similar to what i am looking at.
Can someone point me to a good API which does this ?
...
I use the following code to convert a gif file to a jpg file, it works but the result jpg file isn't the same quality as the original gif file, why ? Any way to improve the quality ?
try
{
ImageIO.write(ImageIO.read(new File("C:/abc.gif")),"jpg",new File("C:/abc.jpg"));
}
catch (Exception e) { e.printStackTrace(); }
So, to ask this ...
My first instinct is to branch normally (using p4 integrate), and then use an IDE or sed script to change the package names. But this makes future integration from the trunk extremely painful.
...
I have a bunch of data coming in (calls to an automated callcenter) about whether or not a person buys a particular product, 1 for buy, 0 for not buy.
I want to use this data to create an estimated probability that a person will buy a particular product, but the problem is that I may need to do it with relatively little historical data ...
I'm having this strange error.
On AIX, if I can reach my server from the command line ( using ping / telnet )
But If I try using java I've got UnkownHostException
This is due to Java cannot somehow "use" the DNS but I don't know why. If I use the IP address it works fine.
This is my test program.
import java.net.*;
public ...
Hello I am trying to create a custom descriptor ref in my parent pom which packages all dependencies with sources. I got the assembly.xml nailed down pretty well, but when I add it to my base POM assembly:assembly fails like so:
[INFO] [assembly:assembly]
[INFO] ------------------------------------------------------------------------
[E...
Can any one suggest good XSLT with java tutorials?
...