java

What are my options to store and query huge amounts of data where a lot of it is repeating ?

I am evaluating options for efficient data storage in Java. The data set is time stamped data values with a named primary key. e.g. Name: A|B|C:D Value: 124 TimeStamp: 01/06/2009 08:24:39,223 Could be a stock price at a given point in time, so it is, I suppose, a classic time series data pattern. However, I really need a generic RDBMS...

String Comparison : individual comparison Vs appended string comparison

I have six string variables say str11, str12, str13, str21, str21 and str23. I need to compare combination of these variables. The combinations I have to check is str11 -- str12 -- str13 as one group and str21 -- str22 -- str23 as other group. I have to compare these two groups. Now I'm in confusion which method should I use for compa...

Java map with values limited by key's type parameter

Is there a way in Java to have a map where the type parameter of a value is tied to the type parameter of a key? What I want to write is something like the following: public class Foo { // This declaration won't compile - what should it be? private static Map<Class<T>, T> defaultValues; // These two methods are just fine ...

java webpart like asp.net ?

I was reading asp.net webpart technology which gives users some personalization abilities under some rules and tools of webparts. are there something like webpart technology lib under java ? ...

Vehicle Tracking System[java/j2ee]

I am interested in building a vehicle tracking system using GPRS. However, I have some questions for anyone who has done this before: Is GPRS the best technology to use? Any problems people are aware of? I am planning on using Java/J2EE - is there any better technologies? If someone has built this before - do you have some examples of ...

How to organize the controller of a MVC-based program with multiple screens/panels?

I'm currently working on a hobby project, written in Java, containing about two different JFrames with about 3-4 JPanels each. The problem I'm facing is that I'm not so sure how to handle the interaction with my controller and different view classes. For instance, I've an article by Sun on Java App. design with MVC, where they list the ...

ExecutorService vs Swing Timer

I've been reading Filthy Rich Clients lately and noticed that, although the version of Java is 6, there is no mention of the Concurrent Framework. So, they talk about java.util.Timer and javax.swing.Timer but not about the ExecutorService. I read about the advantages of ExecutorService in the question "Java Timer vs ExecutorService" and...

swing components are light-weight ?

Whenever i read about swing they say they are light weight components.so i just googled swing and found that it means swing does not depend on native peers.Is that why they are called "light weight" ? I mean by light weight i thought maybe the swing components occupy less memory than the awt components.isnt that so ? ...

Can Hibernate return a collection of result objects OTHER than a List?

Does the Hibernate API support object result sets in the form of a collection other than a List? For example, I have process that runs hundreds of thousands of iterations in order to create some data for a client. This process uses records from a Value table (for example) in order to create this output for each iteration. With a List...

Is Google Web Toolkit useful to develop complex javascripts ?

Iam a great fan of javascript frameworks especially jQuery .I have always wanted to design sites like "plurk.com" but i know that it needs very huge lines of javascript.so that shut me off.But since i came to know GWT , i really want to test it out and want to ask you if it makes our job easier to develop complex things than with the jav...

How do I set Java's min and max heap size through environment variables?

How do I set Java's min and max heap size through environment variables? I know that the heap sizes can be set when launching java, but I would like to have this adjusted through environment variables on my server. ...

Java Servlet Filter Equivalent in Ruby [on Rails] and PHP ?

Not sure if the terminology is correct, but are there rough equivalents to Java Servlet Filters in Ruby and PHP ? Are they actual concrete classes ? I assume there is also a number of common web app libraries/frameworks in Python. Is there an equivalent there ? Thanks. === ADDENDUM === On the good advice of Kevin Davis, I just want t...

Trimming the Log4J Message

I have an appender that I only want the first X characters (for this example, we'll say 5) of the message to display. I am using a PatternLayout but I can't get the message to truncate the message correctly. For example, if my log message is The quick brown fox I just want to see : The q When I use this in the Pattern ...

Equivalent code for instance method synchronization in Java

While discussing a Java synchronization question, someone made a comment that the following snippets are not equivalent (and may compile to different bytecodes): public synchronized void someMethod() { //stuff } and public void someMethod() { synchronized (this) { //stuff } } Are they equivalent? ...

How can I determine what the alphabet for a locale is in java ?

I would like to determine what the alphabet for a given locale is, preferably based on the browser Accept-Language header values. Anyone know how to do this, using a library if necessary ? ...

Hide certain actions from Swing's undo manager

I am trying to write a JTextPane which supports some sort of coloring: as the user is typing the text, I am running some code that colors the text according to a certain algorithm. This works well. The problem is that the coloring operations is registered with the undo manager (a DefaultDocumentEvent with EventType.CHANGE). So when the ...

quick-and-dirty vs. good design

What do you do when your manager wants you to implement something in a quick and dirty way and you just know it's going to backfire? My manager wants me to develop a web app for a client and to do it as quickly as possible. This is the first web app we're building for this client, and I think it's important that we do it right so that ...

Running a new executable file of a Java application, saving a session

Hello, here is a rather newbie question, but it'll be very helpful if you give me some clues. I am running a Java application (with Gui). Every time I exit the Gui, the session (what I have done in the Gui) is saved, and next time when I start the Gui, the saved session is loaded. When I install the application in another directory, an...

Abstract classes and methods in Java, Inheritance

Hello, I have class B, which inherits from class A. The superclass A is abstract, containing one abstract method. I don't want to implement the abstract method in class B, therefore I need to declare class B as abstract as well. Declaring class B abstract, two things are working for me (the programs compile and run correctly): 1.) I do...

Track used applications

I've been using Wakoopa recently, and I find it quite amusing. I had no idea ( well I had an idea but never got real data about it ) on how much time I spend in SO until this: So my programming question is: How can I programmatically track the applications being used? My initial though was to use something like "tasklist" co...