java

How to prefetch Oracle sequence ID-s in a distributed environment

I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine. The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just issue these queries: select seq...

Which jstl url should I reference in my jsps?

I'm getting the following error when trying to run a jsp. I'm using Tomcat 6.0.18, and I'd like to use the latest version of jstl. What version of jstl should I use, and which URL goes with which version of jstl? I'm getting this error "According to TLD or attribute directive in tag file, attribute key does not accept any expressions"...

How Would You Programmatically Create a Pattern from a Date that is Stored in a String?

I have a string that contains the representation of a date. It looks like: Thu Nov 30 19:00:00 EST 2006 I'm trying to create a Date object using SimpleDateFormat and have 2 problems. 1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat constructor 2.) I can't find a way I could parse the string usi...

Propagation of Oracle Transactions Between C++ and Java

We have an existing C++ application that we are going to gradually replace with a new Java-based system. Until we have completely reimplemented everything in Java we expect the C++ and Java to have to communicate with each other (RMI, SOAP, messaging, etc - we haven't decided). Now my manager thinks we'll need the Java and C++ sides to...

Do you know any graph visualization libraries for .NET?

Do you know any libraries that would handle displaying of graph structures in .NET? I'm looking for something similar to java libraries: jgraph or Netbeans Visual Library. I'd like to display objects as nodes in the graph. ...

How to start learning JAVA for use with Oracle RDBMS?

Hi! I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE for a beginner? ...

Is JINI at all active anymore?

Everyone I talk to who knows (knew) about it claims it was the greatest thing since sliced bread. Why did it fail? Or, if it didn't fail, who's using it now? ...

Why am I getting a ClassCastException when generating javadocs?

I'm using ant to generate javadocs, but get this exception over and over - why? I'm using JDK version 1.6.0_06. [javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc [javadoc] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java...

Java Delegates?

Does the Java language have delegate features, similar to how C# has support for delegates? ...

Java: Flash a window to grab user's attention

Is there a better way to flash a window in Java than this: public static void flashWindow(JFrame frame) throws InterruptedException { int sleepTime = 50; frame.setVisible(false); Thread.sleep(sleepTime); frame.setVisible(true); Thread.sleep(sleepTime); frame.setVisible(false); Thread.sleep(sleepTime); ...

C++ and SOAP

I have a C++ app that needs to connect to a JAVA web app, are there any good, open source SOAP packages for this, or would it be easier to just roll my own? ...

Tomcat doFilter() invoked with committed response

I have a Tomcat Filter that delegates requests to the a handling object depending on the URL. This is the only filter in the FilterChain. I have an Ajax app that hammers this filter with lots of requests. Recently I noticed an issue where the filter's doFilter method is often called with a committed response as a parameter (Internally, ...

Why does the Eclipse code formatter break </a> in a Javadoc @see tag?

I'm using Eclipse 3.4 and have configured the Java code formatter with all of the options on the Comments tab enabled. The problem is that when I format a document comment that contains: * @see <a href="test.html">test</a> the code formatter inserts a space in the closing HTML, breaking it: * @see <a href="test.html">test< /a> Why?...

Struts 2: return to calling page

Hi there. I'm using Struts 2. I'd like to return from an Action to the page which invoked it. Say I'm in page x.jsp, I invoke Visual action to change CSS preferences in the session; I want to return to x.jsp rather than to a fixed page (i.e. home.jsp) Here's the relevant struts.xml fragment: <action name="Visual" class="it.___.w...

How do I return a 403 Forbidden in Spring MVC?

I want my controller to return the right HTTP response code when the user lacks permission to view a particular page. ...

How can I convince GroovyShell to maintain state over eval() calls?

I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loaded. GroovyShell maintai...

Sockets and Processes in Java

In Java, what would the best way be to have a constantly listening port open, and still send upon receipt of a packet. I'm not particularly savvy with network programming at the moment, so the tutorials I've found on the net aren't particularly helpful. Would it make sense to have the listening socket as a serversocket and run it in a s...

Can you disable the back button in a JFace wizard?

I'm writing a wizard for an Eclipse RCP application. After doing some processing on a file and taking some user input, I don't want to let the user go back to make changes. At this point they must either accept or reject the changes they are about to make to the system. What I can't seem to find is a method call that lets me override ...

How to multiply 10 to an "Integer" object in Java?

How do I multiply 10 to an Integer object and get back the Integer object? I am looking for the neatest way of doing this. I would probably do it this way: Get int from Integer object, multiply it with the other int and create another Integer object with this int value. Code will be something like ... integerObj = new Integer(intege...

What are the Java regular expressions for matching IPv4 and IPv6 strings?

Looking for a string to pass to String#matches(String) that will match IPv4, and another to match IPv6. ...