java

How to "walk around" in the File System with Java

Hi. I'd like to do a search for folders/directories from java, and go into those folders/directories in java. I guess it's called system utilities? Any tutorials out there, or books on the subject? Thanks ;) ...

MYSQL & Java Applet

Hello, I am currently changing a java desktop application over to a java applet. Everything is working fine, but as soon as the applet attempts to make a mysql database call, it does not work. The code in the desktop application is fine, but as soon as its called from the application its not working. Do any changes need to be made to t...

Is this statement correct in java ?

Hello all.I would like to do a data transfer between two computers using datagram socket.Iam using the following line this way : host=InetAddress.getByAddress("mypc",new byte[]{192,168,1,110}); but when i use the above statement i get this error :"Possible loss of precision" So i cast the int to bytes this way : InetAddress.getByAd...

As a Java developer what should I be expected to know?

With the constant updating of technologies surrounding Java, as a Java developer what is the base knowledge you should be expected to have? Should a Java developer know EJB3, Spring, Hibernate etc? ...

Monitor cpu usage per thread in java?

Hi, I would like to ask whether there is some simple way to determine cpu usage per thread in java. Thanks ...

Why does an update overwrite a date value to null in j2me?

I display the data to be edited as follows private void carryOutNameSearch(TextBox theInputScreen, Form theOutputForm, int formType) { listOfIDs = new Vector(); // save IDs of records in case we want to delete theOutputForm.deleteAll(); // clear the form try { //RecordStore rs = RecordStore.openRecordStore...

what happens in a java jvm executing legacy code, which was invalidated by a language change

Suppose you have legacy java code which can not be compiled by an up-to-date version of java. e.g. public class ProviderUnavailableException extends Exception { private int cause; public int getCause(){ return cause; } // rest of implementation } Back at the time of Java 1.3 this code was valid. In Java 1.4 th...

scrollPane remains gray randomly when it should display editorPane (html)

For some reason my HTML page is not appearing 100% on screen when it should, it looks like a timing issue to me. If I remove scrollpane and use just EditorPane it works ok. What kind of code should I add below to force java applet screen to redraw/refresh and can I somehow wait until all images were really loaded ok? Currently images a...

Java Network Programming. Question about sockets

I have a server and has 2 clients connecting to it through TCP. These clients continuously send information to the server. This is a proxy server and relays the messages it receives from the client. But it has to do relay the messages alternately. i.e. message from client A, then message from client B and again A then B and so on. This I...

oracle jdbc driver version madness

Why the heck does Oracle offer a different(!) version of the JDBC driver, e.g. ojdbc14.jar, for every(!) database version? The files all have different sizes and thus probably different content. background: We get a random and seemingly irreproducible error saying "invalid number" when saving data (we guess it's the Timestamp). But it's...

kodo/jdo/FatalInternalException ?

Hi, anyone has an idea why this error happens or where I can get the JAR file which contains this class? Caused by: java.lang.NoClassDefFoundError: kodo/jdo/FatalInternalException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at $Proxy0.<clinit>(Unknown Source) at s...

Sharing serial port (Modem protocol + dialer)

Hi, I wanted to use this code to send archives with Xmodem: http://www.java2s.com/Code/Java/Network-Protocol/JModemsimplecommunicationsprogram.htm In this case, I want to establish a dialup connection between two computers and send a binary file. But this code doesn't let me set a phone number to dial after i setup the port and before I...

No response in Eclipse: File ->Import->Existing Projects into Workspace

I'm trying to import one of the GWT samples into Eclipse by following the instructions below. But when I browse to the directory containing the "Hello" sample and uncheck "Copy projects into workspace", the Finish button is grayed out, preventing me from completing the import. Any ideas why? -- Option A: Import your project into Ecli...

How to override a java method from groovy

I have a groovy class that has the ability to write its output to a StringWriter. (via a setStringWriter method) In java I would use the following code: filter.setStringWriter(new StringWriter(){ @Override public void write(String string){ // do something with the string } }); For Groovy I'm told to use a closure, I...

How do I convert a decimal fraction to binary in Java?

I need to convert 0.5 in base 10 to base 2 (0.1). I have tried using Double.doubleToRawLongBits(0.5) and it returns 4602678819172646912 which I guess is in hex, but it does not make sense to me. ...

Class in buildpath-jar still not found

I'm developing a eclipse plugin rcp and I'm running into a NoClassDefFoundError Exception in thread "Thread-7" java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder at org.geonames.WebService.search(WebService.java:783) at geo.GeocoderGeonames$SearchThread.run(GeocoderGeonames.java:119) Caused by: java.lang.ClassNotFo...

Hibernate : Best way to delete elements in a collection

A problem that I often face with Hibernate is having a list (call it listA) of objects that I want to persist against an entity (myEntity) but having to first compare them to the existing list on the entity and delete those that aren't in listA. The simple way to do this is to clear the list on the Entity and just add all of listA to th...

Findbugs filter file for ignoring JUnits

Hi guys, I need to set up a filter file for my findbugs ant script that scans only the src/* files and not the test/* files. What is the syntax for checking all classes while ignoring any filename or package name with 'test' in the name? Thanks ...

Can an include file call a function from another include file?

I am new to working with jsp. The scenario is that all of the jsp pages will always have include file A. Some of these pages will need to call functions from include file B. My question is, can I call a function from include file A from functions inside include file B? Wikipedia says: It is as if the contents of the included file...

Regular expression for excluding special characters

Hi, I am having trouble coming up with a regular expression which would essentially black list certain special characters. I need to use this to validate data in input fields (in a Java Web app). We want to allow users to enter any digit, letter (we need to include accented characters, ex. french or german) and some special characters...