java

Java Database Poller?

Are there any JAVA API's for polling a database. Should be able to a) Be able to get all the data from a table to start with. b) Poll it every configurable minutes. ...

In a class with two timers, do they execute in two separate threads?

In a java class i have two timers TimerTask t1 = new TimerTask() {.. } TimerTask t2 = new TimerTask() { ...} Do t1 and t2 execute as two separate threads, how do you verify it ...

.NET equivalent of modern Java web architecture

Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring MVC for the web tier, Spring for the "Service"/business-logic-layer and an ORM mapper such as Hibernate for persistence. What is the equivalent in .NET? I guess ASP.NET is used for the web tier and ADO.NET for persistence but what is the equivale...

What tag libraries you know for J2EE JSP, something like displaytag ?

What tag libraries you know for J2EE - JSP, something like displaytag ? ...

Identify Bluetooth NetworkInterface from Java?

Hi everyone, I need to access the bluetooth network interface from Java. All local network interfaces can be reached via: Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); This enumeration will contain ethernet cards, usb networking devices etc and I need to retrieve the bluetooth network interface i...

How do I handle Microsoft outlook winmail.dat? Any other surprises?

Hi guys Ive decided that I really dont like microsoft and their ways. Please could you give me directions on how to handle winmail.dat in emails, is there a jython library or a java library that will allow me to handle this. Ive just completed a email processing program, written in jython 2.2.1 on java 5. During the final load test, I ...

What does this Java error message entail? And how can i fix it?

I get this message when trying to communicate with software that communicates with SOAP? Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled. I am using a third party API to communicate with an Ardome MAM system. ...

Hibernate and Spring transactions - using private constructors/static factory methods

We have a Hibernate/Spring application that have the following Spring beans: <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" /> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" /> When wiring the application together we get...

What is a good book for a Java Enterprise Developer?

I'm going to buy a few books for my company. Can you recommend some good books dealing with newest trends on market - especially those with JEE? EDIT: I have some experience with pure Java desktop programming. But I need books that will give good overview about Java's EE technologies, also about using tools such as Eclipse, debugging, a...

caching a tar inside jvm for faster file I/O?

Hi, I'm working on a java web application that uses thousands of small files to build artifacts in response to requests. I think our system could see performance improvements if we could map these files into memory rather than run all over the disk to find them all the time. I have heard of mmap in linux, and my basic understanding of...

Highly unusual situation - Thread blocked on a lock which it is holding ???

This java program I am working on seems to hang on startup, so I tried using jconsole to debug the problem. As it turns out it is waiting on a call to a method which is declared as - synchronized void stopQuery() But here is the crazy part, the lock for the 'synchronized' method is already held by the thread which is blocked for it. I...

reading serial port in java

Hi, i'm begginer in java,i'm reading data from device throgh serial port,i'm getting data for every one minute but first reading is coming half,after that data is coming corectly output i'm getting is:6050.003120815340006050.003120815350006050.0 correct output should be like this:03120815340006050.003120815350006050.0 my code is: im...

ODBC to JDBC datatypes mapping

Where can I find description of how to map ODBC datatypes to JDBC? Or maybe anybody knows where source code of a jdbc-odbc bridge driver can be downloaded? ...

Can you access EntityManagers from EntityListeners?

I'm aware that JSR-000220 Enterprise JavaBeans 3.0 Final Release (persistence) spec states: "In general, portable applications should not invoke EntityManager or Query operations, access other entity instances, or modify relationships in a lifecycle callback method." This appears extremely restrictive. We have a situation in which we w...

Is Java suitable for "Web 2.0" applications?

I was chatting to someone the other day who suggested that Rails and PHP are the most suitable platforms for web applications, and to avoid Java. My background is mainly Java, and I know that it is considered by some to be too verbose and "heavyweight", but is used occasionally (e.g. by LinkedIn). So I'm wondering whether anyone has had...

Equality comparison -- any saner way?

How do I implement this equality comparison is a sane java way? boolean x = (a == b) || (a.equals(b)) I want to make sure the content of both objects is equal but null is also ok, i.e. both can be null and are thus equal. Update: just to be clear, I have to implement this comparison several times and don't want to copy&paste this...

Polymorphism

Hello, I have an interface called Dictionary which has a method insert(). This interface is implemented by class BSTree, but I also have a class AVLTree which is a child class of BSTree. AVLTree redefines the insert() so it suits it's needs. Now if I type the following code: Dictionary data=new AVLTree(); data.insert(); there is a pr...

How to set Cursor type in JDBC?

I'm running tomcat and have some jsp pages that display a subset of a table. I show 20 rows at a time on a single page. When the table has large amounts of data, the jsp page doesn't render. I'm guessing that the ResultSet is using a client side cursor. I've worked with ASP in the past, and we always used server side forward only cur...

What is the 'correct' way to store a native pointer inside a Java object?

What is the 'correct' way to store a native pointer inside a Java object? I could treat the pointer as a Java int, if I happen to know that native pointers are <= 32 bits in size, or a Java long if I happen to know that native pointers are <= 64 bits in size. But is there a better or cleaner way to do this? Edit: Returning a native poi...

Oracle table change monitor

Hi Folks, I have a java application that is connected to a view on a remote Oracle db. Does anyone know of a way in Java to monitor this table for changes ? I.e. if there are inserts of updates etc I would need to react. Thanks in advance Len ...