java

Hibernate: Retrieve rows that are not joined

I have two tables joined together with entities like this (entities anonymized, and trimmed of irrelevant properties): Email - Email_ID - Title - Body (hibernate uses a Body_ID field here) Body - Body_ID - Body_Text I'd like to retrieve all Email entries that do not have an associated Body row (ie, Body_ID is null). What HQL wou...

How best to search binary data for variable length bit strings?

Can anyone tell me the best way to decode binary data with variable length bit strings in java? For example: The binary data is 10101000 11100010 01100001 01010111 01110001 01010110 I might need to find the first match of any of the following 01, 100, 110, 1110, 1010... In this case the match would be 1010. I then need to...

Can you change the background and/or foreground colors of an SWT TabItem?

I'd like to change the background and/or foreground colors of the text on an SWT TabItem; however, it (and it's class hierarchy) don't seem to have methods for this - and I can't seem to find any other members I can get ahold of to do this. Ideas? ...

How to go about participating in an open source Java project?

If you would think about participating in the opensource - java, where you would look at? what would you choose? I've tried to participate to one project which need to sign a contribution agreement, they haven't responded to me and I cannot participate even though I think I knew about one bug and I could improve a component at least I ...

keeping JTable selection in viewport

I'm using GlazedLists to autogenerate an EventTableModel from an EventList, for use with a JTable in a JScrollbarPane. I'm using the EventList as a FIFO, a bunch of elements are added to the end, then a bunch of elements are sometimes removed from the beginning. When elements are removed, the selection works exactly as I expect: even th...

JFreeChart-like in Delphi

Hi! I have worked with JFreeChart in a few Java projects. I wonder if there is something similar I can use in Delphi for Win32 or if you know about a nice free chart library for Delphi. I'm working with Delphi 2006. I know there is already TChart but it looks a bit "old". My researchs bring me to TMS Advanced Charts but it's too expensiv...

Good TCP connection library for Java?

I am looking for a good TCP connection library from Java with the following facilities: 1. Retry on failed publishes 2. Multiple connections Which library have you sucessfully used. EDIT: Based on the comment changed the question to reflect which type of connection library. ...

Abstract Inheritance and Generics (with playing cards)

So, I've been working on some playing cards in Java. (Not for any practical purpose really, I just enjoy playing cards and they're good practice) Now, right now, I'm making some Card Structures, decks, hands, piles, etc. They're all essentially the same, so I figure that I'd like to use some inheritance. The problem that I've encount...

Passing several parameters as a single parameter in Java.

I've seen an example of it before, but I've never really found any good reference material dealing with it. I know it's possible to pass in several parameters, ints for example, by defining the method as public void aMethod(int...a) But I don't know any more about it than that. I've seen an example, and it returned the average of ...

Simple for loop question.

Currently I am studying for my Java test. Whist studying I've come across a small problem. In this for loop: for ( int i=1; i <= 3 ; i++ ) { for (int j=1; j <= 3 ; j++ ) { System.out.println( i + " " + j ); } } The output is: 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 My problem is, I don't understand it. When I read thi...

Secure JDBC connection

I have a plain Java application which is supposed to connect to the database. I don't want to store database connection url and username/password in a properties file or hardcode it in application. What is a common way to solve this problem? How a Java application can connect to database without revealing username/password? ...

Implementing Future in CLDC 1.1

I really like the concept of FutureValues. http://c2.com/cgi/wiki?FutureValue And although I'm working in a CLDC 1.1 environment (Blackberry), I'm wondering if it is possible to implement it with the available wait-notify / Threading support in Java 1.3. Basically I want to create: ExecutorService - to start threads Each thread then c...

What are some good patterns for performing initial configuration of a web application?

I have a Java web application designed to be deployed on the internet. It needs a database connection. Depending upon hosting environments it may not be possible for the deployers of the web application to configure appropriate data sources so the application needs to store it's database connection information somewhere to be reloaded if...

Eclipse RCP case study, please help to solve!

I am interested to learn about Eclipse RCP, I have got some basic knowledge, but I wanted to know more what it is capable of. So I encouraged my self to create a set of requirements, analyze them, and come up with design decisions about how they can be met using Eclipse RCP as the base framework, and eventually implement them with Eclip...

JAXB gives me: java.lang.IllegalArgumentException: is parameter must not be null

I am doing using JAXB to unmarshall some XML into Java objects: My code looks a little like this: InputStream testMsg = getClass().getResourceAsStream("TestDocumentEvent.xml"); Unmarshaller unmarshaller = JAXBContext.newInstance(DocumentEvent.class).createUnmarshaller(); DocumentEvent unmarshalled = (DocumentEvent) unmarshaller.unmarsh...

Dynamically load additional jar files using Web Start / JNLP

The Web Start Developers Guide states All application resources must be retrieved from the JAR files specified in the resources section of the JNLP file, or retrieved explicitly using an HTTP request to the Web server. Storing resources in JAR files is recommended, since they will be cached on the local machine by J...

JMS alternative? something for decoupling sending emails from http reqs

Hi, we have a web application that does various things and sometimes emails users depending on a given action. I want to decouple the http request threads from actually sending the email in case there is some trouble with the SMTP server or a backlog. In the past I've used JMS for this and had no problem with it. However at the moment f...

What is your preferred scripting language in java world (scripting language on JVM) and way?

What is your preferred scripting language in java world (scripting language on JVM) and way? When do you prefer your scripting language over java (in what situations for example for prototyping)? Do you use it for large projects or for personal projects only? ...

How to assign a String from a text file into integer array for Java?

How to assign a String from a text file into integer array for Java? I had saved the integer array into a text file, but now how can I retrieve all the integer array from the text file without any modification? I want the integer array retrieved same as before it stored into the text file. Below is part of my code: BufferedWriter f1 = n...

Error starting SQL Developer

HI everyone. I am trying to run sqldeveloper on my Red Hat Linux Enterprise 5 machine but get the following error: [root@machine plugins]# sqldeveloper Oracle SQL Developer Copyright (c) 2006, 2007, Oracle. All rights reserved. WARNING: error instantiating 'java.util.logging.FileHandler,' referenced by handlers, class not found java...