java

Authenticating against Active Directory with Java on Linux

Hello, I have a simple task of authenticating against Active Directory using Java. Just verifying credentials and nothing else. Let's say my domain is "fun.xyz.tld", OU path is unknown, and username/password is testu/testp. I know there's a few Java libraries out there that simplify this task, but I wasn't successful at implementing t...

Sparse matrices / arrays in Java

I'm working on a project, written in Java, which requires that I build a very large 2-D sparse array. Very sparse, if that makes a difference. Anyway: the most crucial aspect for this application is efficency in terms of time (assume loads of memory, though not nearly so unlimited as to allow me to use a standard 2-D array -- the key r...

Helping a beginner for java web application

I have pretty big background of .net, and I've decided that i want to port one of my websites to Java. (now with the asp.net MVC craze, I've figured I'd better learn a more mature approach to MVC). i've downloaded eclipse (easyeclipse distro to be exact, and am ready and willing to develop my first website in java). i've programmed j2m...

Java while loop and Threads!

I have a program that continually polls the database for change in value of some field. It runs in the background and currently uses a while(true) and a sleep() method to set the interval. I am wondering if this is a good practice? And, what could be a more efficient way to implement this? The program is meant to run at all times. Conse...

Java: Adding a User Interface to a program

If I have Java program and I need to alter it to an interface and include icons, is there any easy I can do this and is there a good application that can help me to do it ? or do I have to code it in myself? ...

Good free UML tool for Java/Eclipse?

I'm looking for a free and easy-to-use UML diagramming tool for Java. In particular I'd looking for something that would integrate with Eclipse, as most of my codebase is in Eclipse. Any recommendations? ...

determining java memory usage

Hmmm. Is there a primer anywhere on memory usage in Java? I would have thought Sun or IBM would have had a good article on the subject but I can't find anything that looks really solid. I'm interested in knowing two things: at runtime, figuring out how much memory the classes in my package are using at a given time at design time, esti...

issuing hard drive commands with java

Does anyone know of a way to issue commands to a hard drive within Java? Does Java even support this kind of hardware interaction? For example, if I have a SCSI hard drive that I would like to inquiry, is there a pre-existing Java method to do this, or would I have to write my own? http://en.wikipedia.org/wiki/SCSI has some general inf...

JRE on Android

This might sound like a stupid question, but google didn't help me. Is there a JRE available for Android? If so which version is it? Are there any major features missing? If not does that mean all java apps need to be recompiled for Dalvik to work on the Android? Update; Will there ever be JRE available for the Android? ...

What is the purpose of the expression "new String(...)" in Java?

While looking at online code samples, I have sometimes come across an assignment of a String constant to a String object via the use of the new operator. For example: String s; ... s = new String("Hello World"); This, of course, compared to s = "Hello World"; I'm not familiar with this syntax and have no idea what the purpose or e...

Open a file with an external application on Java

How do you open a file from a java application when you do not know which application the file is associated with. Also, because I'm using Java, I'd prefer a platform independent solution. ...

Code standards in agile teams with modern IDEs?

We're an agile project of about 20 developers organized in 2-3 teams, doing no pair programming, a little bit team rotation and a lot of peer reviews. Most of us are addicted to the "green status bar" of IDE code analysis (most of use idea, some eclipse and netbeans, resharper is idea functionality in the .net world). We are considering...

Meaning of serial port parameters in Java?

I'm a beginner in Java. I'm reading data from the serial port. I got serialPort.setSerialPortParams( 9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); What is the meaning of 9600, DATABITS_8,STOPBITS_1 and PARITY_NONE? ...

Logging user actions

The customer wants us to "log" the "actions" that a user performs on our system: creation, deletion and update, mostly. I already have an aspect that logs the trace, but that works at a pretty low level logging every method call. So if a user clicked on the button "open medical file" the log would read: closePreviousFiles("patient zer...

Problem with VisualVM-when connecting to remote host

Hi All, I am new to Java Development and using the VisualVm for the first time. I am facing some problem in Connecting a Remote Host from the VisualVm interface. I have JDK 1.6 running in the remote host and also started jstatd server on the same. When I am connecting the remote host from VisualVm interface running in local machine, ...

How does Hibernate create proxies of concrete classes?

To the best of my knowledge, creating a dynamic Java proxy requires that one have an interface to work against for the proxy. Yet, Hibernate seems to manage its dynamic proxy generation without requiring that one write interfaces for entity classes. How does it do this? The only clue from the Hibernate documentation refers to the fact th...

best (or at least good) guide to Java annotations

There must be a good book/PDF/HTML file that describes the essentials & good practices of annotations in Java. I sort of know what they are from other good Java books, but I'm looking for something that would teach me most of what I would need to know to make good use of them. (preferably in PDF/HTML so I can print it out & read at my le...

Looking for recommendations for end-to-end Java CPU Profilers

What are some good end to end CPU profilers that exist for Java? Quick list of things I'm looking for: Offline profiling - No user interaction or GUI required during program execution. Dumping the profile data to a file and then requiring viewing afterwards with a GUI is fine, I just don't want to have to babysit it as the job runs En...

What exactly is "Abrupt completion of a finally clause"?

According to the Java Language Specification: If there are any enclosing try statements whose try blocks contain the throw statement, then any finally clauses of those try statements are executed as control is transferred outward, until the thrown value is caught. Note that abrupt completion of a finally clause can disrupt the transf...

How do I manage to get a non-null name argument with org.xml.sax.ext.EntityResolver2 resolveEntity method ?

In Java SAX processing, I dot not manage to obtain entity reference names from the org.xml.sax.ext.EntityResolver2 resolveEntity method. The name argument is always null even if the documentation states that "'name' is never null when invoked by a SAX2 parser". Any idea ? To demonstrate the issue, I have created a Jython 2.5 script. I...