java

Where do you put your SQL Queries?

We are using a mix of EJB 2.1 and JDBC to access our Database. I just had a co-worker mention the idea to put his SQL Queries into a .properties file. How and Where do you put your SQL Queries? EDIT: Do you inline it with the code, put into the class instantiation? ...

Comment the interface, implementation or both?

I imagine that we all (when we can be bothered!) comment our interfaces. e.g. /// <summary> /// Foo Interface /// </summary> public interface Foo { /// <summary> /// Will 'bar' /// </summary> /// <param name="wibble">Wibble factor</param> void Bar(string wibble); } Do you also comment the implementation (which may...

DTO, DAO, and DCO. What is a DCO?

My search for the meaning of DCO was quite fruitless, so I decided to ask here. In my Java application, there are many classes like EmployeeDetailsDto, EmployeeDetailsDao, but recently I also came across EmployeeDetailsDco. Does anyone know what does the DCO stand for? ...

How to fetch current year and month from MySQL in JAVA?

Hi, I want to fetch the records from MySQL for the current year and month. I am passing to get the today records Today: ("recDate","=", new Date()); Like that, how to fetch for current Month and current Year ? Thanks in advance Gnaniyar Zubair ...

openssl des3 decrypting in java

is there a way to decrypt files that have been encrypted using openssl -des3 enc command. Exactly how does openssl use the password and salt to make the key? ...

Lombardi Java API

Hi Can anyone give me some links for JAVA API for Lombardi BPM. Adhir ...

Is Apache XML security library compatibile with IBM's JDK

I developed an application that uses Apache XML security library for xml encryption and signing. It runs on SUN's JDK without any problems, however, IBM JDK gives me tons of problems. It doesn't sign right (validation fails), pkcs11 provider fails to encrypt. It seems that problem is because IBM provides their own security providers. ...

What are good InstallAnywhere replacements for installing a Java EE application?

Which (commercial or free) installer tool would you recommend to replace InstallAnywhere as the installer for a Java EE application? What do you specifically like about it, and what are its downsides? Some requirements: Must support running custom Java code as part of installation procedure Must support Windows, including latest 64-bi...

POI 3.2 Image Height/Width controlling

Using POI version 3.2 Issue: Not able to resize an image to its original height and width. I am able to add an image to the excel file. After adding image I call picture.resize(); method. Later I resize the columns of the excel file by calling sheet.setColumnWidth(columnindex, columnwidth) the image losses its original height/width. ...

How to add total page number on every page with iText?

How to add the total page number on every page with iText? ...

Using java, how do you get the amount of free space on a solaris zfs file system?

Using java, how do you get the amount of free space on a solaris zfs file system? I have a SunFire x4140 with built-in hdd mounted as /. It also has a connected JBOD with 7.6TB of HDD space, configured as a ZFS file system and mounted as /app. I use java.io.File.getUsableSpace or java.io.File.getFreeSpace to get the amount of free spac...

JarScan, Scan all jar files in all subfolders for specific class.

We are seeing an older version of a class being used although we had the latest one deploy, to scan all jar files in all subfolders of appserver we need to write a small shell scripts that prints out jars in which this specific class is found. ...

How do you merge two input streams in Java?

Having two InputStreams in Java, is there a way to merge them so you end with one InputStream that gives you the output of both streams? How? ...

ActiveX in Java - Can't QI object for IDispatch

I am having an exception like this: Exception in thread "main" com.jacob.com.ComFailException: Can't QI object for IDispatch at com.jacob.com.Dispatch.createInstanceNative(Native Method) at com.jacob.com.Dispatch.<init>(Dispatch.java:101) at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58) at test.Test...

create a war file

I want to create a war file for project. The code works fine for creating jar file. when I run the following ant build.xml it still gives the message jar file BUILD SUCCESSFULL. <project name="struts-spring" basedir="../" default="all"> <!-- Project settings --> <property name="project.title" value="Sufalam Struts 2 Tutorials"/>...

Can i get the execution trace for a test case for a java program?

I want to run a java program with some test input values and when the execution ends I want to know the complete execution trace, for each conditional statement - what path was followed. Is there anything that can help me with this? ...

IDE plugins for developing JMX Model MBeans

I am looking for a plugin that helps developers create JMX Model MBeans that works with either Eclipse and/or Netbeans. I am aware of the JMX Plugin for Netbeans that allows for creating of simple MBeans but looking for something more advanced. ...

Reimplementing the "ToneMatrix" audio toy

There is a really cool audio "toy" called ToneMatrix. I would like to reimplement it as a Java applet. I've tried using JFugue's player.play with individual notes for sound and Thread.sleep for timing, but the results are horrible. JFugue stops responding after the 17th (yes, really, I counted) invocation of player.play and Thread.sleep...

Are there any other open source JCE libraries besides BouncyCastle?

I am looking for open source JCE libraries that implement some of the more esoteric encryption algorithms so that I can study their implementation. I would be especially interested in ones that implement Identity Based Encryption (IBE) as published by Stanford. ...

Popular JSP/Servlet/Portlet Error Log Viewer?

After reading the latest Coding Horror post I wondered if there was a Java-based version of ELMAH out there in the open source community? A configurable JSP/Servlet/Portlet WAR that I can just drop into most servers and have a nice GUI for viewing the logs in the system. Anyone have a project to recommend? Duplicate of http://...