java

Java library or code sample to parse CTXCAT query syntax (for Oracle CATSEARCH)

I am interested in pre-parsing a user's input via Java for valid CTXCAT syntax before it is used to search against an Oracle CATSEARCH implementation (http://www.oracle.com/technology/products/text/htdocs/ctxcat_primer.html). The reason being is that Oracle returns a generic parse exception if the query contains any invalid syntax (such...

Where is the current version of the Java Virtual Machine Specification?

It would appear as though the only way to get the current version of the Java Virtual Machine Specification is to take the Second Edition, merge in the Existing Changes and then add on top of that the Java6 proposed changes which are not really proposed anymore, but actual. Really? Two question arise out of this: Is that all the delt...

How to determine if a given URL link is a video or image?

I'm trying to take a given URL entered by user and determine if the URL is pointing to a image or a video. Example use case. When a user paste in the URL of a youtube video, on save the page will auto display the embedded Youtube player. When a user poaste int he URL of a picture in flickr, on save, the page will auto display a small...

How to the JVM to use a given jaas.conf file?

How to I setup the JVM to use a given jaas.conf I created as JAAS setup? Maybe there is a JAAS picks up a configuration property which I can set on startup with -D? ...

How many JDBC connections in Java ?

I have a Java program consisting of about 15 methods. And, these methods get invoked very frequently during the exeuction of the program. At the moment, I am creating a new connection in every method and invoking statements on them (Database is setup on another machine on the network). What I would like to know is: Should I create only...

Can I discover a Java class' declared inner classes using reflection?

In Java, is there any way to use the JDK libraries to discover the private classes implemented within another class? Or do I need so use something like asm? ...

Spring and hibernate.cfg.xml

How do I get Spring to load Hibernate's properties from hibernate.cfg.xml? We're using Spring and JPA (with Hibernate as the implementation). Spring's applicationContext.xml specifies the JPA dialect and Hibernate properties: <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> <propert...

How to setup JAAS (in jaas.conf) to use NTLoginModule?

I guess an example of jaas.conf file that uses the NTLoginModule for authentication would help. ...

Java and unix

I want to delete the old log files in log directory. To delete the log files which are more than 6 months, I have written the script like find /dnbusr1/ghmil/BDELogs/import -type f -mtime +120 -exec rm -f {} \; By using this script i can able to delete the old files. But how to invoke this script by using java? please any one help me....

Invoking via command line versus JNI

I need to invoke tesseract OCR (its an open source library in C++ that does Optical Character Recognition) from a Java Application Server. Right now its easy enough to run the executable using Runtime.exec(). The basic logic would be Save image that is currently held in memory to file (a .tif) pass in the image file name to the tessera...

JavaFX in the wild?

Does anybody know of any real-world web applications based on JavaFX? I'm an experienced Java programmer considering starting a website while I'm not at my day job. I don't have a lot of expertise on the UI side, so I'm looking for the best way to leverage my existing skills to create something that can provide an awesome RIA experienc...

why do functions dont have parameterized return types, as it has parameterized input?

This always forces us to return a single parameter in case I need to return multiple, say a List and a String. This restriction is not there in function arguments. ...

Any good resource for java interview questions ?

Can somebody point me to a good interview question repository for java/j2ee programming and architect position? ...

Byte stream / C / JNI

What data types are usually used in C API implementation for storing byte streams? How can I convert this type to jbyteArray? ...

prettifying Java XML output

I have a simple question about Java's XML API and I hope there's a simple answer too: Lets say that after processing I have the following XML output: <a> <b><c> <d> <e> some content </e> </d> </c> </b> </a> The structure is correct but whitespaces are all over the place. The question is that how can I prettify the ou...

Re-scaling automatic build from 2-cpu pizza-boxes to multi-cpu monster(s) ?

Our current automated build consists of 1 master box and 4 core-2-duo pizza boxed (at around 2.5Ghz), with 3 GB memory each, all runing ubuntu linux. (Using bamboo) I have been asked to recalibrate this for running on one or more solaris boxes. Our current build consists of a mix of java builds, long running integration test builds and ...

Is there a Java equivalent to Apple's Core Data?

I have recently heard a lot of praise for Apple's Core Data architecture. Is there something similar in Java land, so that I can play around with Core Data's ideas (in order to evaluate how it stacks up against something like Hibernate) without having to get into Cocoa/Objective-C first? ...

JasperReport - taking too much resources

so, problem is when we are showing to user created document in JasperReport Dialog. User can press print icon and sent it to printer. It seems to take too much resources on client's computer on all three levels: creating report, showing report on screen and sending it to printer. One example PC is AMD Duron 800MHz with 256MB of RAM so ...

Smooth process during development of Java web applications - how are you doing it?

Share anything you find important and think could be of use to others. Some questions you might want to answer: Do you use Jetty to run the application during development? Do you use another database than MySQL during development? How do you manage dependencies? Do you use Eclipse, NetBeans or other IDE's? Why did you make your IDE ch...

Best continuous integration setup for multi-platform development

What is the best continuous integration setup for a Devleopment department that codes in multiple environments? At my company we write some code in C# and some in Java, I've previously used CC.Net but I've never done CInt with Java. I'm aware of Continuum and was recently told about Hudson, but I've never used either. Would it be bett...